Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] refactor content to focus on React usage #2574

Merged
merged 68 commits into from
Jun 18, 2018
Merged
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
84b24ed
Button: collapse css examples
Jun 3, 2018
88d7eef
Callout + intent docs
Jun 3, 2018
7c84f9b
Progress bar
Jun 3, 2018
a97ed98
Skeleton, Spinner , Table
Jun 3, 2018
ade11f7
add new buttons example
Jun 3, 2018
81ae9ad
breadcrumbs docs
Jun 6, 2018
e32f5a3
button groups docs
Jun 6, 2018
56bdc97
card docs
Jun 6, 2018
c7eae76
collapse docs
Jun 6, 2018
c10b97d
collapsible list docs
Jun 6, 2018
8895038
editable text docs
Jun 6, 2018
9d3c39a
more collapsible list
Jun 6, 2018
ae43f5e
more card
Jun 6, 2018
7e378a7
remove button group code block
Jun 6, 2018
efb12d7
comments
Jun 6, 2018
42f4698
navbar docs
Jun 6, 2018
485f01d
hotkeys docs
Jun 6, 2018
f0fcefb
icon docs
Jun 6, 2018
3a45a6b
menu docs
Jun 6, 2018
54b08e9
alert docs
Jun 7, 2018
250e96f
fix collapsible separators
Jun 7, 2018
62a1a74
context menu docs
Jun 7, 2018
b81708a
dialog docs
Jun 7, 2018
6b543e4
editable text fixes
Jun 7, 2018
ad47dc0
label docs
Jun 7, 2018
5c9a9b2
navbar docs
Jun 7, 2018
291fc00
non ideal state docs
Jun 7, 2018
d343b19
add props heading to overflow list
Jun 7, 2018
3d9bde3
overlay docs
Jun 7, 2018
a783fff
popover docs
Jun 7, 2018
de75a53
portal docs
Jun 7, 2018
5110042
tabs docs
Jun 7, 2018
24048ec
tag docs
Jun 7, 2018
7cbe942
text docs
Jun 7, 2018
cfd897a
toast docs
Jun 7, 2018
4674b0f
tooltip docs
Jun 7, 2018
150ff2a
tree docs
Jun 7, 2018
a7149f7
context menu usage
Jun 7, 2018
d2864dc
wrong tick
Jun 7, 2018
010deea
CSS -> Style
Jun 7, 2018
9eee697
move portal props down
Jun 8, 2018
d7a2ea9
tabs props
Jun 8, 2018
8fc3962
text update
Jun 8, 2018
700573a
merge minimal tag CSS docs
Jun 8, 2018
4e2cf4a
Merge branch 'develop' into gg/docs-rewrite
giladgray Jun 8, 2018
e53a8c1
Merge branch 'develop' of github.com:palantir/blueprint into gg/docs-…
Jun 13, 2018
bf7ab8b
card polish
Jun 13, 2018
2e30276
CollapsibleList polish
Jun 13, 2018
350495b
EditableText polish
Jun 13, 2018
433bd8a
Icon polish
Jun 13, 2018
19323a1
Menu polish
Jun 13, 2018
7a441ca
Spinner polish
Jun 13, 2018
5f97289
Navbar polish
Jun 13, 2018
f638e8c
NIS polish
Jun 13, 2018
e973f94
Progress Bar, Table HTML, Tag, Tree polish
Jun 13, 2018
7445031
Spinner polish (remove CSS)
Jun 13, 2018
31577f2
Tabs polish
Jun 13, 2018
e604814
all Overlays polish
Jun 13, 2018
e346900
singular component page titles
Jun 13, 2018
c930adb
[docs] improve button-group docs (#2594)
giladgray Jun 13, 2018
ff3686e
[docs] refactor datetime docs to focus on React usage (#2596)
giladgray Jun 18, 2018
9a72afd
[docs] refactor forms docs (#2600)
giladgray Jun 18, 2018
49efb7e
Merge branch 'develop' of github.com:palantir/blueprint into gg/docs-…
Jun 18, 2018
52e4f3c
edits
Jun 18, 2018
4b89911
tag-input add note about newlines, wrap lines
Jun 18, 2018
156b9b8
FileInput docs
Jun 18, 2018
2912c95
checkbox etc docs
Jun 18, 2018
094af73
resolve forms nav: Form controls & Form inputs sections
Jun 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Navbar polish
  • Loading branch information
Gilad Gray committed Jun 13, 2018
commit 5f972893ba58b1dbdc9f7d9ad55be0e9067a6472
71 changes: 35 additions & 36 deletions packages/core/src/components/navbar/navbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,51 @@

Navbars present useful navigation controls at the top of an application.

The `.@ns-navbar` CSS component can have up to two groups of elements: a left-aligned group and a
right-aligned group. These groups can contain multiple elements, which are laid out horizontally.

@reactExample NavbarExample

@### Fixed to viewport top

Enable the `fixedToTop` prop to attach a navbar to the top of the viewport using
`position: fixed; top: 0;`. This is so-called "sticky" behavior: the navbar
stays at the top of the screen as the user scrolls through the document.

This modifier is not illustrated here because it breaks the document flow.

<div class="@ns-callout @ns-intent-danger @ns-icon-error">
<h4 class="@ns-heading">Body padding required</h4>
The fixed navbar will lie on top of your other content unless you add padding to the top of the
`<body>` element equal to the height of the navbar. Use the `$pt-navbar-height` Sass variable.
</div>

@### Fixed width

If your application is inside a fixed-width container (instead of spanning the
entire viewport), you can align the navbar to match by wrap your navbar groups
in an element with your desired `width` and `margin: 0 auto;` to horizontally
center it.

@css navbar-container

@## Props

These components are simple wrappers around the corresponding CSS APIs. Each of
them supports the full range of HTML props.
The `Navbar` API includes four stateless React components:

* `Navbar`
* `NavbarGroup` (aliased as `Navbar.Group`)
* `NavbarHeading` (aliased as `Navbar.Heading`)
* `NavbarDivider` (aliased as `Navbar.Divider`)

`NavbarGroup`, `NavbarHeading`, and `NavbarDivider` can be referenced by their aliases
as well: `Navbar.Group`, `Navbar.Heading`, and `Navbar.Divider`, respectively.
These components are simple containers for their children. Each of them supports
the full range of HTML `<div>` props.

```tsx
<Navbar>
<NavbarGroup align={Alignment.LEFT}>
<NavbarHeading>Blueprint</NavbarHeading>
<NavbarDivider />
<Navbar.Group align={Alignment.LEFT}>
<Navbar.Heading>Blueprint</NavbarHeading>
<Navbar.Divider />
<Button className="@ns-minimal" icon="home" text="Home" />
<Button className="@ns-minimal" icon="document" text="Files" />
</NavbarGroup>
</Navbar.Group>
</Navbar>
```

Expand All @@ -44,28 +68,3 @@ Use the following classes to construct a navbar:
* `.@ns-navbar-divider` &ndash; Thin vertical line that can be placed between groups of elements.

@css navbar

@### Fixed to viewport top

Add the `.@ns-fixed-top` class to the `.@ns-navbar` to attach it to the top of the viewport using
`position: fixed; top: 0;`. This is so-called "sticky" behavior: the navbar stays at the top of the
screen as the user scrolls through the document.

This modifier is not illustrated here because it breaks the documentation flow.

<div class="@ns-callout @ns-intent-danger @ns-icon-error">
<h4 class="@ns-heading">Body padding required</h4>
The fixed navbar will lie on top of your other content unless you add padding to the top of the
`<body>` element equal to the height of the navbar. Use the `$pt-navbar-height` Sass variable to
access the height of the navbar (50px).
</div>

@### Fixed width

If your application is inside a fixed-width container (instead of spanning the entire viewport), you
can align the navbar to match.

Wrap your `.@ns-navbar-group`s in an element with your desired `width` and `margin: 0 auto;` to
horizontally center it.

@css navbar-container