Skip to content

Commit 8229d99

Browse files
committed
Add basic examples
1 parent 7d90afe commit 8229d99

File tree

5 files changed

+122
-0
lines changed

5 files changed

+122
-0
lines changed

examples/ArrayDefaultExample.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import * as React from "react";
2+
3+
import { Example, IExampleProps } from "@blueprintjs/docs-theme";
4+
import Form from '../src/index';
5+
6+
export class ArrayDefaultExample extends React.Component<IExampleProps, undefined> {
7+
public render() {
8+
return (
9+
<Example options={false} {...this.props}>
10+
<Form>
11+
{{
12+
title: "A registration form",
13+
description: "The description",
14+
type: "object",
15+
properties: {
16+
"array": {
17+
type: "array",
18+
ui: "tuple",
19+
items: [
20+
{
21+
type: "string",
22+
title: "Elem1 - string",
23+
minLength: 3,
24+
},
25+
{
26+
type: "string",
27+
title: "Elem2 - string",
28+
}
29+
],
30+
},
31+
},
32+
}}
33+
</Form>
34+
</Example>
35+
);
36+
}
37+
}
38+

examples/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./ArrayDefaultExample";

src/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
reference: react-json-blinkforms
3+
---
4+
5+
@# React-json-blinkforms
6+
7+
Components elo
8+
9+
@page renderers

src/renderers/ArrayDefault.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
@# ArrayDefault
2+
3+
Navbars present useful navigation controls at the top of an application.
4+
5+
@reactExample ArrayDefaultExample
6+
7+
@### Fixed to viewport top
8+
9+
Enable the `fixedToTop` prop to attach a navbar to the top of the viewport using
10+
`position: fixed; top: 0;`. This is so-called "sticky" behavior: the navbar
11+
stays at the top of the screen as the user scrolls through the document.
12+
13+
This modifier is not illustrated here because it breaks the document flow.
14+
15+
<div class="@ns-callout @ns-intent-danger @ns-icon-error">
16+
<h4 class="@ns-heading">Body padding required</h4>
17+
The fixed navbar will lie on top of your other content unless you add padding to the top of the
18+
`<body>` element equal to the height of the navbar. Use the `$pt-navbar-height` Sass variable.
19+
</div>
20+
21+
@### Fixed width
22+
23+
If your application is inside a fixed-width container (instead of spanning the
24+
entire viewport), you can align the navbar to match by wrap your navbar groups
25+
in an element with your desired `width` and `margin: 0 auto;` to horizontally
26+
center it.
27+
28+
@css navbar-container
29+
30+
@## Props
31+
32+
The `Navbar` API includes four stateless React components:
33+
34+
* `Navbar`
35+
* `NavbarGroup` (aliased as `Navbar.Group`)
36+
* `NavbarHeading` (aliased as `Navbar.Heading`)
37+
* `NavbarDivider` (aliased as `Navbar.Divider`)
38+
39+
These components are simple containers for their children. Each of them supports
40+
the full range of HTML `<div>` props.
41+
42+
```tsx
43+
<Navbar>
44+
<Navbar.Group align={Alignment.LEFT}>
45+
<Navbar.Heading>Blueprint</Navbar.Heading>
46+
<Navbar.Divider />
47+
<Button className="@ns-minimal" icon="home" text="Home" />
48+
<Button className="@ns-minimal" icon="document" text="Files" />
49+
</Navbar.Group>
50+
</Navbar>
51+
```
52+
53+
@interface INavbarProps
54+
55+
@interface INavbarGroupProps
56+
57+
@interface INavbarHeadingProps
58+
59+
@interface INavbarDividerProps
60+
61+
@## CSS
62+
63+
Use the following classes to construct a navbar:
64+
65+
* `nav.@ns-navbar` &ndash; The parent element. Use a `<nav>` element for accessibility.
66+
* `.@ns-navbar-group.@ns-align-(left|right)` &ndash; Left- or right-aligned group.
67+
* `.@ns-navbar-heading` &ndash; Larger text for your application title.
68+
* `.@ns-navbar-divider` &ndash; Thin vertical line that can be placed between groups of elements.
69+
70+
@css navbar

src/renderers/renderers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@# Components
2+
3+
<!-- Exact ordering of components in the navbar: -->
4+
@page ArrayDefault

0 commit comments

Comments
 (0)