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
@@ -56,14 +57,15 @@ PatternFly supports several properties and variations that can be used to add ex
56
57
- If there is a description passed via `children` prop, then the `component` prop should be a heading element. Headings should be ordered by their level and heading levels should not be skipped. For example, a heading of an `h2` level should not be followed directly by an `h4`.
Use the `timeout` property to automatically dismiss an alert after a period of time. If set to `true`, the `timeout` will be 8000 milliseconds. Provide a specific value to dismiss the alert after a different number of milliseconds.
104
106
105
107
```ts
108
+
import { Fragment, useState } from 'react';
106
109
import { Alert, AlertActionLink, AlertGroup, Button } from '@patternfly/react-core';
@@ -161,9 +164,10 @@ It is not recommended to use an expandable alert with a `timeout` in a [toast al
161
164
See the [toast alert considerations](/components/alert/accessibility#toast-alerts) section of the alert accessibility documentation to understand the accessibility risks associated with using toast alerts.
<p>Success alert description. This should tell the user more information about the alert.</p>
195
199
</Alert>
196
-
</React.Fragment>;
200
+
</Fragment>;
197
201
```
198
202
199
203
### Truncated alerts
200
204
201
205
Use the `truncateTitle` property to shorten a long `title`. Set `truncateTitle` equal to a number (passed in as `{n}`) to reduce the number of lines of text in the alert's `title`. Users may hover over or tab to a truncated `title` to see the full message in a tooltip.
202
206
203
207
```ts
208
+
import { Fragment } from 'react';
204
209
import { Alert } from '@patternfly/react-core';
205
210
206
-
<React.Fragment>
211
+
<Fragment>
207
212
<Alert
208
213
variant="info"
209
214
truncateTitle={1}
@@ -225,58 +230,61 @@ import { Alert } from '@patternfly/react-core';
225
230
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
226
231
`}
227
232
/>
228
-
</React.Fragment>;
233
+
</Fragment>;
229
234
```
230
235
231
236
### Custom icons
232
237
233
238
Use the `customIcon` property to replace a default alert icon with a custom icon.
234
239
235
240
```ts
241
+
import { Fragment } from 'react';
236
242
import { Alert } from '@patternfly/react-core';
237
243
import UsersIcon from '@patternfly/react-icons/dist/esm/icons/users-icon';
238
244
import BoxIcon from '@patternfly/react-icons/dist/esm/icons/box-icon';
239
245
import DatabaseIcon from '@patternfly/react-icons/dist/esm/icons/database-icon';
240
246
import ServerIcon from '@patternfly/react-icons/dist/esm/icons/server-icon';
241
247
import LaptopIcon from '@patternfly/react-icons/dist/esm/icons/laptop-icon';
Use inline alerts to display an alert inline with content. All alert variants may use the `isInline` property to position alerts in content-heavy areas, such as within forms, wizards, or drawers.
0 commit comments