Skip to content

Commit e897960

Browse files
committed
feat: Add rough draft of Float docs
The Float functionality for our components should be properly documented with its own page on the hosted webpage. It should also include proper examples of how to use it.
1 parent 4e27a26 commit e897960

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

www/src/components/SideNav.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const TocSubLink = styled(TocLink)`
103103

104104
const gettingStarted = ['introduction', 'theming', 'support'];
105105

106-
const layout = ['float', 'grid', 'media'];
106+
const layout = ['grid', 'media'];
107107

108108
const components = [
109109
'alerts',
@@ -135,7 +135,12 @@ const components = [
135135
'toasts',
136136
];
137137

138-
const utilities = ['transitions', 'responsive-embed', 'react-overlays'];
138+
const utilities = [
139+
'float',
140+
'transitions',
141+
'responsive-embed',
142+
'react-overlays',
143+
];
139144

140145
// We need to configure this
141146
function attachSearch(ref) {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<>
2+
<Toast float={{ md: 'right' }}>
3+
<Toast.Header>
4+
<strong className="mr-auto">Bootstrap</strong>
5+
<small>11 mins ago</small>
6+
</Toast.Header>
7+
<Toast.Body>
8+
Hello, world! This is a toast message, using float right
9+
</Toast.Body>
10+
</Toast>
11+
<Toast float={{ md: 'none' }}>
12+
<Toast.Header>
13+
<strong className="mr-auto">Bootstrap</strong>
14+
<small>11 mins ago</small>
15+
</Toast.Header>
16+
<Toast.Body>
17+
Hello, world! This is a toast message, using float none
18+
</Toast.Body>
19+
</Toast>
20+
</>;

www/src/pages/utilities/float.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
import ReactPlayground from '../../components/ReactPlayground';
3+
4+
import ToastExample from '../../examples/Float/ToastExample';
5+
6+
# Float
7+
8+
Bootstrap allows for floats to be toggled on any Bootstrap component,
9+
so this re-implementation aims to provide the same support.
10+
11+
## Supported Components
12+
13+
TODO: Find all instances of components implementing `createBootstrapComponent`
14+
15+
## Basic Example
16+
17+
For the supported components, passing in an object to the `float` prop
18+
with valid properties will allow to use the power of Bootstrap float classes
19+
20+
<ReactPlayground codeText={ToastExample} />
21+
22+
## Supported Props
23+
24+
These are the list of properties that can be in the `float` prop object:
25+
- default
26+
- sm
27+
- md
28+
- lg
29+
- xl
30+
31+
Out of these properties, the following values can be passsed in:
32+
- left
33+
- right
34+
- none

0 commit comments

Comments
 (0)