1

After installing the Blueprintjs core package I wanted to get started with the Navbar component but when I import it, it is not found within the node module.

In the github repo there is only a SCSS file in the component's directory while in the docs a Navbar component is mentioned which makes me doubt.

Are not all components React components?

Thanks

Jeroen
  • 33
  • 7
  • Check out this page for information on the usage. http://blueprintjs.com/docs/#components.usage – Tyler Sebastian Mar 21 '17 at 23:11
  • Thanks for taking the time to respond @TylerSebastian but I don't understand how your answer relates to my question. I have installed Blueprint and am able to use various React components such as the date input. No problem there. My question is if it is meant to be that the navbar does not have a React component or if I am missing something. – Jeroen Mar 22 '17 at 15:23
  • 2
    @Jeromche I took your question as an inspiration and decided to make a library with those "missing" components from Blueprint https://github.com/Landish/blueprint-components . – Lado Lomidze Sep 20 '17 at 20:13

2 Answers2

3

UPDATE: The Navbar component now offers a JS API as of @blueprintjs/core v1.34.0 (release | PR).

2

Yes, .pt-navbar is CSS only. There is no Navbar React component because there's no fancy logic, just a bunch of class names.

You can use the constants defined in Blueprint.Core.Classes to simplify the rendering. See https://github.com/palantir/blueprint/blob/release-1.13.0/packages/core/src/common/classes.ts#L100-L103.

(EDIT: Components declare whether they provide a JavaScript API, CSS API, or both. Just look at the headings.)

Update: I merged the new answer of Chris Lewis in the accepted answer because the existing accepted answer is no longer valid for the latest version of Blueprintjs:

The Navbar component now offers a JS API as of @blueprintjs/core v1.34.0 (release | PR).

Mark Walet
  • 1,147
  • 10
  • 21
Gilad Gray
  • 451
  • 2
  • 6
  • 1
    Thank you. I suppose the decision was made to keep it simple. For my own use case I've created the React components so that I can reuse them freely in our codebase and have the ability to update easily if the HTML/CSS changes in the future. – Jeroen Mar 26 '17 at 15:04