Skip to content

Commit 75e564d

Browse files
committed
docs: add RTL docs
1 parent 22d8d84 commit 75e564d

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

www/src/components/SideNav.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const gettingStarted = [
104104
'why-react-bootstrap',
105105
'theming',
106106
'support',
107+
'rtl',
107108
];
108109

109110
const layout = ['grid'];
@@ -154,6 +155,12 @@ function attachSearch(ref) {
154155
});
155156
}
156157

158+
const nameOverrides = {
159+
'why-react-bootstrap': 'Why React-Bootstrap',
160+
rtl: 'RTL',
161+
'restart-ui': '@restart/ui',
162+
};
163+
157164
function NavSection({ heading, location: { pathname }, items, path }) {
158165
let active = pathname.startsWith(path);
159166
return (
@@ -174,10 +181,7 @@ function NavSection({ heading, location: { pathname }, items, path }) {
174181
{items.map((name) => (
175182
<Nav.Item key={`${path}/${name}/`}>
176183
<TocSubLink href={`${path}/${name}/`}>
177-
{startCase(name.toLowerCase()).replace(
178-
'React Bootstrap',
179-
'React-Bootstrap',
180-
)}
184+
{nameOverrides[name] || startCase(name.toLowerCase())}
181185
</TocSubLink>
182186
</Nav.Item>
183187
))}

www/src/pages/getting-started/rtl.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import DocLink from '../../components/DocLink';
2+
import DismissibleControlled from '../../examples/Alert/DismissibleControlled';
3+
import ReactPlayground from '../../components/ReactPlayground';
4+
5+
# RTL
6+
7+
We recommend first reading <DocLink path="/getting-started/rtl">Bootstrap's documentation</DocLink>
8+
to become familiar with how Bootstrap's RTL support works.
9+
10+
In order to enable RTL support with React-Bootstrap, follow these steps:
11+
12+
1. Set `dir="rtl"` on the `<html>` element.
13+
2. Add an appropriate lang attribute, like `lang="ar"`, on the `<html>` element.
14+
3. Include the RTL version of the CSS `bootstrap.rtl.min.css` in your project.
15+
4. Set `dir="rtl"` in a `ThemeProvider`:
16+
17+
```jsx
18+
<ThemeProvider dir="rtl">
19+
<App />
20+
</ThemeProvider>
21+
```

0 commit comments

Comments
 (0)