Skip to content

Commit fc000b5

Browse files
author
matdsoupe
committed
adds Nav and Navbar components
1 parent 571d08b commit fc000b5

File tree

4 files changed

+119
-91
lines changed

4 files changed

+119
-91
lines changed

src/Nav.res

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@module("react-bootstrap") @react.component
2+
external make: (
3+
~id: string=?,
4+
~activeKey: string=?,
5+
~className: string=?,
6+
~navbarScroll: bool=?,
7+
~_as: string=?,
8+
~fill: bool=?,
9+
~justify: bool=?,
10+
~navbar: bool=?,
11+
~navbarBsPrefix: string=?,
12+
~cardHeaderBsPrefix: string=?,
13+
~role: string=?,
14+
~onSelect: (~eventKey: string, ~event: ReactEvent.Synthetic.t) => unit=?,
15+
~onKeyDown: unit => unit=?,
16+
~variant: [#tabs | #pills],
17+
~className: string=?,
18+
~children: React.element,
19+
~bsPrefix: string=?,
20+
) => React.element = "Nav"
21+
22+
module Item = {
23+
@module("react-bootstrap") @scope("Nav") @react.component
24+
external make: (
25+
~id: string=?,
26+
~className: string=?,
27+
~children: React.element,
28+
~_as: string=?,
29+
~bsPrefix: string,
30+
) => React.element = "Item"
31+
}
32+
33+
module Link = {
34+
@module("react-bootstrap") @scope("Nav") @react.component
35+
external make: (
36+
~id: string=?,
37+
~children: React.element,
38+
~_as: string=?,
39+
~active: bool=?,
40+
~disabled: bool=?,
41+
~href: string,
42+
~className: string=?,
43+
~eventKey: string=?,
44+
~role: string=?,
45+
~bsPrefix: string=?,
46+
) => React.element = "Link"
47+
}

src/NavDropdown.res

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@module("react-bootstrap") @react.component
2+
external make: (
3+
~active: bool=?,
4+
~disabled: bool=?,
5+
~id: string=?,
6+
~menuRole: string=?,
7+
~menuVariant: [#dark]=?,
8+
~onClick: ReactEvent.Mouse.t => unit=?,
9+
~renderMenuOnMount: bool=?,
10+
~rootCloseEvent: string=?,
11+
~title: string,
12+
~className: string=?,
13+
~children: React.element,
14+
~bsPrefix: string=?,
15+
) => React.element = "NavDropdown"

src/Navbar.res

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@module("react-bootstrap") @react.component
2+
external make: (
3+
~id: string=?,
4+
~_as: string=?,
5+
~children: React.element,
6+
~bg: string=?,
7+
~expand: [#sm | #md | #lg | #xl | #xxl],
8+
~expanded: bool=?,
9+
~fixed: [#top | #bottom],
10+
~role: string=?,
11+
~variant: [#light | #dark],
12+
~collapseOnSelect: bool=?,
13+
~onSelect: (~eventKey: string, ~event: ReactEvent.Synthetic.t) => unit=?,
14+
~onToggle: bool => unit=?,
15+
~sticky: [#top]=?,
16+
~className: string=?,
17+
~bsPrefix: string=?,
18+
) => React.element = "Navbar"
19+
20+
module Brand = {
21+
@module("react-bootstrap") @scope("Navbar") @react.component
22+
external make: (
23+
~is: string=?,
24+
~_as: string=?,
25+
~href: string,
26+
~className: string=?,
27+
~children: React.element,
28+
~bsPrefix: string=?,
29+
) => React.element = "Brand"
30+
}
31+
32+
module Collapse = {
33+
@module("react-bootstrap") @scope("Navbar") @react.component
34+
external make: (
35+
~id: string=?,
36+
~className: string=?,
37+
~children: React.element,
38+
~bsPrefix: string=?,
39+
) => React.element = "Collapse"
40+
}
41+
42+
module Toggle = {
43+
@module("react-bootstrap") @scope("Navbar") @react.component
44+
external make: (
45+
~id: string=?,
46+
~_as: string=?,
47+
~children: React.element=?,
48+
~label: string=?,
49+
~onClick: ReactEvent.Mouse.t => unit=?,
50+
~\"aria-controls": string=?,
51+
~className: string=?,
52+
~bsPrefix: string=?,
53+
) => React.element = "Toggle"
54+
}

src/ReactBootstrap.res

Lines changed: 3 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -23,94 +23,6 @@ module InputGroup = InputGroup
2323
module Image = Image
2424
module ListGroup = ListGroup
2525
module Modal = Modal
26-
27-
module Navbar = {
28-
@module("react-bootstrap") @react.component
29-
external make: (
30-
~id: string=?,
31-
~_as: string=?,
32-
~children: React.element,
33-
~bg: string=?,
34-
~expand: [#sm | #md | #lg | #xl | #xxl],
35-
~expanded: bool=?,
36-
~fixed: [#top | #bottom],
37-
~role: string=?,
38-
~variant: [#light | #dark],
39-
~collapseOnSelect: bool=?,
40-
~sticky: string=?,
41-
~className: string=?,
42-
) => React.element = "Navbar"
43-
44-
module Brand = {
45-
@module("react-bootstrap") @scope("Navbar") @react.component
46-
external make: (
47-
~is: string=?,
48-
~_as: string=?,
49-
~href: string,
50-
~className: string=?,
51-
~children: React.element,
52-
) => React.element = "Brand"
53-
}
54-
55-
module Collapse = {
56-
@module("react-bootstrap") @scope("Navbar") @react.component
57-
external make: (
58-
~id: string=?,
59-
~className: string=?,
60-
~children: React.element,
61-
) => React.element = "Collapse"
62-
}
63-
64-
module Toggle = {
65-
@module("react-bootstrap") @scope("Navbar") @react.component
66-
external make: (
67-
~id: string=?,
68-
~_as: string=?,
69-
~children: React.element=?,
70-
~label: string=?,
71-
~\"aria-controls": string=?,
72-
~className: string=?,
73-
) => React.element = "Toggle"
74-
}
75-
}
76-
77-
module Nav = {
78-
@module("react-bootstrap") @react.component
79-
external make: (
80-
~id: string=?,
81-
~activeKey: string=?,
82-
~className: string=?,
83-
~navbarScroll: bool=?,
84-
~_as: string=?,
85-
~fill: bool=?,
86-
~justify: bool=?,
87-
~navbar: bool=?,
88-
~role: string=?,
89-
~variant: [#tabs | #pills],
90-
~className: string=?,
91-
~children: React.element,
92-
) => React.element = "Nav"
93-
94-
module Item = {
95-
@module("react-bootstrap") @scope("Nav") @react.component
96-
external make: (
97-
~id: string=?,
98-
~className: string=?,
99-
~children: React.element,
100-
~_as: string=?,
101-
) => React.element = "Item"
102-
}
103-
104-
module Link = {
105-
@module("react-bootstrap") @scope("Nav") @react.component
106-
external make: (
107-
~id: string=?,
108-
~children: React.element,
109-
~_as: string=?,
110-
~active: bool=?,
111-
~disabled: bool=?,
112-
~href: string,
113-
~className: string=?,
114-
) => React.element = "Link"
115-
}
116-
}
26+
module Nav = Nav
27+
module NavDropdown = NavDropdown
28+
module Navbar = Navbar

0 commit comments

Comments
 (0)