You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Aria components can be styled in many ways, including using CSS classes, inline styles, utility classes (e.g. Tailwind), CSS-in-JS (e.g. Styled Components), etc. By default, all components include a builtin `className` attribute which can be targeted using CSS selectors. These follow the `react-aria-ComponentName` naming convention.
178
-
179
-
```css
180
-
.react-aria-Breadcrumbs {
181
-
/* ... */
182
-
}
183
-
```
184
-
185
-
A custom `className` can also be specified on any component. This overrides the default `className` provided by React Aria with your own.
186
-
187
-
```jsx
188
-
<Breadcrumbs className="my-breadcrumbs">
189
-
{/* ... */}
190
-
</Breadcrumbs>
191
-
```
192
-
193
-
In addition, some components support multiple UI states (e.g. focused, placeholder, readonly, etc.). React Aria components expose states using data attributes, which you can target in CSS selectors. For example:
194
-
195
-
```css
196
-
.react-aria-Link[data-current] {
197
-
/* ... */
198
-
}
199
-
```
200
-
201
-
The `className` and `style` props also accept functions which receive states for styling. This lets you dynamically determine the classes or styles to apply, which is useful when using utility CSS libraries like [Tailwind](https://tailwindcss.com/).
The states, selectors, and render props for all components used in `Breadcrumbs` are documented below.
208
-
209
-
### Breadcrumbs
210
-
211
-
`Breadcrumbs` can be targed with the `.react-aria-Breadcrumbs` CSS selector, or by overriding with a custom `className`. It is rendered as a `<nav>` element, and contains an `<ol>` element representing the list of items. This additional element can be targed with the `ol` selector.
212
-
213
-
```css render=false
214
-
.react-aria-Breadcrumbs {
215
-
& ol {
216
-
/* ... */
217
-
}
218
-
}
219
-
```
220
-
221
-
### Item
222
-
223
-
An `Item` can be targeted with the `.react-aria-Item` CSS selector, or by overriding with a custom `className`. It is rendered as an `<li>` element, and should contain a `<Link>` or `<Heading>`. It may also include another element such as a [separator icon](#separator-icons).
224
-
225
-
### Link
226
-
227
-
A `Link` can be targeted with the `.react-aria-Link` CSS selector, or by overriding with a custom `className`. It clones its only child element (e.g. `<a>`) and adds additional props, which should be passed through to the underlying DOM node. If only text is provided, it is rendered as a `<span>`. Links support the following states and render props:
`Breadcrumbs` follows the [Collection Components API](../react-stately/collections.html), accepting both static and dynamic collections.
236
193
The examples above show static collections, which can be used when the full list of options is known ahead of time. Dynamic collections,
@@ -259,7 +216,7 @@ function Example() {
259
216
}
260
217
```
261
218
262
-
###Heading
219
+
## Heading
263
220
264
221
The last breadcrumb may be used as a heading for the page by placing a `<Heading>` element within the `<Item>` instead of a `<Link>`. By default, this is an `h3` element, but this can be changed with the `level` prop on the `Heading`.
265
222
@@ -273,7 +230,7 @@ import {Heading} from 'react-aria-components';
273
230
</Breadcrumbs>
274
231
```
275
232
276
-
###Router links
233
+
## Router links
277
234
278
235
The `<Link>` component can wrap a custom link element provided by a router like [React Router](https://reactrouter.com/en/main).
279
236
@@ -286,7 +243,7 @@ import {Link as RouterLink} from 'react-router-dom';
286
243
</Breadcrumbs>
287
244
```
288
245
289
-
###Separator icons
246
+
## Separator icons
290
247
291
248
The above examples use the CSS `:after` pseudo class to add separators between each item. These may also be DOM elements instead, e.g. SVG icons. Be sure that they have `aria-hidden="true"` so they are hidden from assistive technologies.
292
249
@@ -315,7 +272,7 @@ import ChevronIcon from '@spectrum-icons/workflow/ChevronDoubleRight';
315
272
316
273
</details>
317
274
318
-
###Disabled
275
+
## Disabled
319
276
320
277
Breadcrumbs can be disabled using the `isDisabled` prop. This indicates that navigation is not currently available. When a breadcrumb is disabled, `onPress` will not be triggered, navigation will not occur, and links will be marked as `aria-disabled` for assistive technologies.
321
278
@@ -337,6 +294,66 @@ Individual breadcrumbs can also be disabled by passing the `isDisabled` prop to
React Aria components can be styled in many ways, including using CSS classes, inline styles, utility classes (e.g. Tailwind), CSS-in-JS (e.g. Styled Components), etc. By default, all components include a builtin `className` attribute which can be targeted using CSS selectors. These follow the `react-aria-ComponentName` naming convention.
304
+
305
+
```css
306
+
.react-aria-Breadcrumbs {
307
+
/* ... */
308
+
}
309
+
```
310
+
311
+
A custom `className` can also be specified on any component. This overrides the default `className` provided by React Aria with your own.
312
+
313
+
```jsx
314
+
<Breadcrumbs className="my-breadcrumbs">
315
+
{/* ... */}
316
+
</Breadcrumbs>
317
+
```
318
+
319
+
In addition, some components support multiple UI states (e.g. focused, placeholder, readonly, etc.). React Aria components expose states using data attributes, which you can target in CSS selectors. For example:
320
+
321
+
```css
322
+
.react-aria-Link[data-current] {
323
+
/* ... */
324
+
}
325
+
```
326
+
327
+
The `className` and `style` props also accept functions which receive states for styling. This lets you dynamically determine the classes or styles to apply, which is useful when using utility CSS libraries like [Tailwind](https://tailwindcss.com/).
The states, selectors, and render props for all components used in `Breadcrumbs` are documented below.
334
+
335
+
### Breadcrumbs
336
+
337
+
`Breadcrumbs` can be targed with the `.react-aria-Breadcrumbs` CSS selector, or by overriding with a custom `className`. It is rendered as a `<nav>` element, and contains an `<ol>` element representing the list of items. This additional element can be targed with the `ol` selector.
338
+
339
+
```css render=false
340
+
.react-aria-Breadcrumbs {
341
+
& ol {
342
+
/* ... */
343
+
}
344
+
}
345
+
```
346
+
347
+
### Item
348
+
349
+
An `Item` can be targeted with the `.react-aria-Item` CSS selector, or by overriding with a custom `className`. It is rendered as an `<li>` element, and should contain a `<Link>` or `<Heading>`. It may also include another element such as a [separator icon](#separator-icons).
350
+
351
+
### Link
352
+
353
+
A `Link` can be targeted with the `.react-aria-Link` CSS selector, or by overriding with a custom `className`. It clones its only child element (e.g. `<a>`) and adds additional props, which should be passed through to the underlying DOM node. If only text is provided, it is rendered as a `<span>`. Links support the following states and render props:
0 commit comments