Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate clayui.com to next #5780

Open
wants to merge 166 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
8568e47
chore: www
matuzalemsteles Mar 6, 2024
bdb201f
chore: update next
matuzalemsteles Mar 7, 2024
1889154
chore: add clay packages
matuzalemsteles Mar 7, 2024
8851c32
chore: update page
matuzalemsteles Mar 7, 2024
fdb5701
feat(www): add mdxts implementation to read documents from clay-core
matuzalemsteles Aug 7, 2024
e2592d6
chore(www): add redirect and sf
matuzalemsteles Aug 9, 2024
5105801
chore(www): add next dependency to root directory
matuzalemsteles Aug 12, 2024
daec9af
chore(www): static documents on build
matuzalemsteles Aug 12, 2024
2fdadca
chore(www): fix error
matuzalemsteles Aug 12, 2024
f6bd022
feat(www): adds HTML/CSS tab support
matuzalemsteles Aug 15, 2024
bbf687e
chore(www): move the alert document to the new pattern
matuzalemsteles Aug 15, 2024
8e154de
chore(www): move the autocomplete document to the new pattern
matuzalemsteles Aug 16, 2024
12073b0
chore(www): move the badge document to the new pattern
matuzalemsteles Aug 16, 2024
0a41aca
chore(www): move the breadcrumb document to the new pattern
matuzalemsteles Aug 16, 2024
e481a0f
chore(www): move the button document to the new pattern
matuzalemsteles Aug 16, 2024
86cff73
chore(www): move the card document to the new pattern
matuzalemsteles Aug 16, 2024
b226b48
chore(www): move the color picker document to the new pattern
matuzalemsteles Aug 16, 2024
aca3df2
chore(www): sf
matuzalemsteles Aug 16, 2024
286a49d
chore(www): move the data provider document to the new pattern
matuzalemsteles Aug 17, 2024
6433f2d
chore(www): move the date picker document to the new pattern
matuzalemsteles Aug 19, 2024
97d1483
chore(www): move the drop down document to the new pattern
matuzalemsteles Aug 20, 2024
2fbc6cf
chore(www): move the empty state document to the new pattern
matuzalemsteles Aug 20, 2024
031655b
chore(www): move the icon document to the new pattern
matuzalemsteles Aug 28, 2024
384cca0
chore(www): sf
matuzalemsteles Aug 28, 2024
7e822e5
chore(www): move the label document to the new pattern
matuzalemsteles Aug 28, 2024
7ab450a
chore(www): move the layout document to the new pattern
matuzalemsteles Sep 2, 2024
dad82eb
chore(www): move the link document to the new pattern
matuzalemsteles Sep 2, 2024
692c765
chore(www): move the list document to the new pattern
matuzalemsteles Sep 2, 2024
1f66b47
chore(www): move the loading indicator document to the new pattern
matuzalemsteles Sep 2, 2024
04e4b6d
chore(www): move the localized input document to the new pattern
matuzalemsteles Sep 3, 2024
c1217ea
chore(www): move the management toolbar document to the new pattern
matuzalemsteles Sep 3, 2024
c5e5247
chore(www): move the modal document to the new pattern
matuzalemsteles Sep 3, 2024
f145b3c
chore(www): move the multi select document to the new pattern
matuzalemsteles Sep 5, 2024
6b6c93b
chore(www): move the multi step nav document to the new pattern
matuzalemsteles Sep 5, 2024
4a18b8f
chore(www): move the nav document to the new pattern
matuzalemsteles Sep 5, 2024
d5b23cb
chore(www): move the navigation bar document to the new pattern
matuzalemsteles Sep 5, 2024
942030e
chore(www): move the pagination document to the new pattern
matuzalemsteles Sep 10, 2024
dfe9312
chore(www): move the pagination-bar document to the new pattern
matuzalemsteles Sep 10, 2024
f1ed20b
chore(www): move the panel document to the new pattern
matuzalemsteles Sep 11, 2024
f3b86dc
chore(www): move the popover document to the new pattern
matuzalemsteles Sep 12, 2024
2c114dc
chore(www): move the progress bar document to the new pattern
matuzalemsteles Sep 12, 2024
e15f8e5
chore(www): move the provider document to the new pattern
matuzalemsteles Sep 12, 2024
3ff700a
chore(www): move the slider document to the new pattern
matuzalemsteles Sep 13, 2024
4d0922a
chore(www): move the sticker document to the new pattern
matuzalemsteles Sep 17, 2024
2a86cd3
chore(www): add table markup document
matuzalemsteles Sep 17, 2024
4f22cd2
chore(www): add tabs markup document
matuzalemsteles Sep 17, 2024
9d3c91b
chore(www): add time picker markup document
matuzalemsteles Sep 18, 2024
41fdefe
chore(www): add time toolbar markup document
matuzalemsteles Sep 18, 2024
ec759ec
chore(www): add tooltip markup document
matuzalemsteles Sep 18, 2024
9e3ff83
chore(www): add upper toolbar markup document
matuzalemsteles Sep 18, 2024
97a8bf2
chore(www): sf
matuzalemsteles Sep 18, 2024
6aac1f0
chore(www): add icon and update packages
matuzalemsteles Sep 19, 2024
662a45a
chore(www): add www to workspace
matuzalemsteles Sep 19, 2024
ec8daf1
chore(@clayui/button): fix bug
matuzalemsteles Sep 20, 2024
93ed47e
chore(www): remove from workspace
matuzalemsteles Sep 20, 2024
c75007b
chore(www): fixes conflict bug with eslint
matuzalemsteles Sep 20, 2024
a380ebe
chore(www): fixes error in build
matuzalemsteles Sep 21, 2024
132e236
chore(www): adjust link colors
matuzalemsteles Sep 24, 2024
da6267a
chore(www): fix active color in sidebar
matuzalemsteles Sep 25, 2024
e4eff1c
feat(@clayui/button): improves component typing to create API Table
matuzalemsteles Oct 10, 2024
524fb77
chore(www): improves the Table API
matuzalemsteles Oct 10, 2024
cebf9c8
feat(@clayui/alert): Improve Alert typing
matuzalemsteles Oct 15, 2024
674b3aa
feat(@clayui/autocomplete): improves component typing to create API T…
matuzalemsteles Nov 5, 2024
b1d679c
feat(@clayui/badge): improves component typing to create API Badge
matuzalemsteles Nov 6, 2024
0da37ce
feat(@clayui/breadcrumb): improves component typing to create API Bre…
matuzalemsteles Nov 6, 2024
f4d6b29
feat(@clayui/multi-select): improves component typing to create API M…
matuzalemsteles Nov 6, 2024
00e0082
feat(@clayui/multi-step-nav): improves component typing to create API…
matuzalemsteles Nov 6, 2024
96beca8
feat(@clayui/core): improves component typing to create API TreeView
matuzalemsteles Nov 7, 2024
0569bde
feat(@clayui/core): improves component typing to create API VerticalBar
matuzalemsteles Nov 7, 2024
0937558
fix(www): fixes bug when importing packages for multiple sources
matuzalemsteles Nov 7, 2024
ca308ab
feat(@clayui/card): improves component typing to create API Card
matuzalemsteles Nov 15, 2024
5441eb6
feat(@clayui/color-picker): improves component typing to create API C…
matuzalemsteles Nov 15, 2024
00ae6b8
feat(@clayui/data-provider): improves component typing to create API …
matuzalemsteles Nov 15, 2024
4a0031c
feat(@clayui/date-picker): improves component typing to create API Da…
matuzalemsteles Nov 15, 2024
d1ea434
feat(@clayui/drop-down): improves component typing to create API Drop…
matuzalemsteles Nov 17, 2024
1137de8
feat(@clayui/core): improves component typing to create API FocusTrap
matuzalemsteles Nov 19, 2024
add1b9b
feat(@clayui/empty-state): improves component typing to create API Em…
matuzalemsteles Nov 19, 2024
6ab6ee8
feat(@clayui/management-toolbar): improves component typing to create…
matuzalemsteles Nov 21, 2024
abd1394
feat(@clayui/modal): improves component typing to create API Modal
matuzalemsteles Nov 21, 2024
35fd03d
fix(@clayui/drop-down): fixes bug when unable to render component API…
matuzalemsteles Nov 22, 2024
2396f37
feat(@clayui/core): improves component typing to create API Heading
matuzalemsteles Nov 22, 2024
10d366a
feat(@clayui/core): improves component typing to create API Text
matuzalemsteles Nov 22, 2024
f4b94d5
feat(@clayui/icon): improves component typing to create API Icon
matuzalemsteles Nov 22, 2024
65aaf24
feat(@clayui/label): improves component typing to create API Label
matuzalemsteles Nov 22, 2024
77da733
feat(@clayui/layout): improves component typing to create API Layout
matuzalemsteles Nov 22, 2024
5955715
feat(@clayui/link): improves component typing to create API Link
matuzalemsteles Nov 22, 2024
de91472
feat(@clayui/list): improves component typing to create API List
matuzalemsteles Nov 22, 2024
b1ee1f0
feat(@clayui/loading-indicator): improves component typing to create …
matuzalemsteles Nov 22, 2024
f5a9ceb
feat(@clayui/localized-input): improves component typing to create AP…
matuzalemsteles Nov 22, 2024
21d6c22
feat(@clayui/core): improves component typing to create API Table Input
matuzalemsteles Nov 27, 2024
39865e9
chore(@clayui/core): sf
matuzalemsteles Nov 27, 2024
9218ca1
feat(@clayui/nav): improves component typing to create API Vertical N…
matuzalemsteles Nov 27, 2024
3d82db0
feat(@clayui/core): improves component typing to create API Nav
matuzalemsteles Nov 27, 2024
7eac095
feat(@clayui/navigation-bar): improves component typing to create API…
matuzalemsteles Nov 27, 2024
047bd8a
feat(@clayui/core): improves component typing to create API OverlayMask
matuzalemsteles Nov 27, 2024
e50fbc9
feat(@clayui/pagination): improves component typing to create API Pag…
matuzalemsteles Nov 27, 2024
52f0303
feat(@clayui/pagination-bar): improves component typing to create API…
matuzalemsteles Nov 27, 2024
e7156da
feat(@clayui/panel): improves component typing to create API Panel
matuzalemsteles Nov 28, 2024
e21fa76
feat(@clayui/picker): improves component typing to create API Picker
matuzalemsteles Nov 28, 2024
6c197f4
feat(@clayui/popover): improves component typing to create API Popover
matuzalemsteles Nov 28, 2024
44fa4a4
feat(@clayui/progress-bar): improves component typing to create API P…
matuzalemsteles Nov 28, 2024
536b6fa
feat(@clayui/provider): improves component typing to create API Provider
matuzalemsteles Nov 28, 2024
83a35cc
feat(@clayui/core): improves component typing to create API Reduced M…
matuzalemsteles Nov 28, 2024
39b0d28
feat(@clayui/slider): improves component typing to create API Slider
matuzalemsteles Nov 28, 2024
de1f6c7
feat(@clayui/sticker): improves component typing to create API Sticker
matuzalemsteles Nov 28, 2024
bab2322
feat(@clayui/tabs): improves component typing to create API Tabs
matuzalemsteles Nov 28, 2024
b1e1e23
feat(@clayui/time-picker): improves component typing to create API Ti…
matuzalemsteles Nov 28, 2024
09e74ea
feat(@clayui/toolbar): improves component typing to create API Toolbar
matuzalemsteles Nov 29, 2024
eb82afe
feat(@clayui/tooltip): improves component typing to create API Tooltip
matuzalemsteles Nov 29, 2024
b4ea7f2
feat(@clayui/upper-toolbar): improves component typing to create API …
matuzalemsteles Nov 29, 2024
1dcc147
chore(www): add checkbox markup document
matuzalemsteles Nov 29, 2024
b8dc350
chore(www): add dual list box markup document
matuzalemsteles Dec 2, 2024
97e8f0d
chore(www): add input and input group markup document
matuzalemsteles Dec 2, 2024
e766501
chore(www): sf
matuzalemsteles Dec 2, 2024
3e071fb
chore(www): add radio document
matuzalemsteles Dec 2, 2024
8c0e017
chore(www): add form document
matuzalemsteles Dec 2, 2024
41aba2c
chore(www): add select document
matuzalemsteles Dec 2, 2024
59ff085
chore(www): add select box document
matuzalemsteles Dec 2, 2024
4eac59c
chore(www): add toggle document
matuzalemsteles Dec 2, 2024
197b55a
chore(www): delete markup-text-input-autocomplete
matuzalemsteles Dec 2, 2024
fc39055
chore(www): add autocomplete markup document
matuzalemsteles Dec 2, 2024
2e7050d
chore(www): sf
matuzalemsteles Dec 2, 2024
d8fdfa4
feat(@clayui/form): improves component typing to create API Form
matuzalemsteles Dec 2, 2024
cf9a9c2
feat(@clayui/form): improves component typing to create API DualListBox
matuzalemsteles Dec 2, 2024
395ec1e
feat(@clayui/form): improves component typing to create API Input
matuzalemsteles Dec 2, 2024
a7d7f57
feat(@clayui/form): improves component typing to create API Radio
matuzalemsteles Dec 2, 2024
3784785
feat(@clayui/form): improves component typing to create API Select
matuzalemsteles Dec 3, 2024
be21064
feat(@clayui/form): improves component typing to create API SelectBox
matuzalemsteles Dec 3, 2024
8f96507
feat(@clayui/form): improves component typing to create API Toggle
matuzalemsteles Dec 3, 2024
c86b4e6
chore(www): sf
matuzalemsteles Dec 3, 2024
e478654
chore(@clayui/form): fix toggle example
matuzalemsteles Dec 3, 2024
8b05c69
feat(www): Improves responsiveness for mobile version
matuzalemsteles Dec 6, 2024
a0f864a
fix(www): fixes API Table props overflow bug
matuzalemsteles Dec 10, 2024
6fe7905
chore(@clayui/core): fix bug on render cells
matuzalemsteles Dec 16, 2024
6afb3ea
docs(@clayui/form): sf
matuzalemsteles Dec 16, 2024
199d378
feat(www): Adds LXC integration
matuzalemsteles Dec 18, 2024
71e21e9
refactor(www): add renoun lib to handle document infra instead of mdxts
matuzalemsteles Jan 6, 2025
91d4091
refactor: Updates the docs to correctly generate the Table API for co…
matuzalemsteles Jan 10, 2025
bb92891
chore: update node to 20.x
matuzalemsteles Jan 10, 2025
6314d49
chore(www): fix postinstall
matuzalemsteles Jan 10, 2025
edebb2e
chore: rollback node to 18.x
matuzalemsteles Jan 10, 2025
aa63833
fix(www): fixes bug in build
matuzalemsteles Jan 10, 2025
efcfe42
docs(@clayui/drop-down): temporarily removes the Table API from DropDown
matuzalemsteles Jan 10, 2025
0677407
chore(www): add ErrorBoundary in API Reference components
matuzalemsteles Jan 13, 2025
83620e7
chore(www): temporarily removes API Reference for some DropDown compo…
matuzalemsteles Jan 13, 2025
48c8500
chore(@clayui/form): fix build error
matuzalemsteles Jan 14, 2025
c924319
chore(www): Adds redirect for new documents
matuzalemsteles Jan 15, 2025
16d22f0
docs: sf
matuzalemsteles Jan 15, 2025
502dd12
docs(www): Adds TreeView HTML/CSS documentation
matuzalemsteles Jan 15, 2025
d4ded17
feat(www): Add blog
matuzalemsteles Jan 22, 2025
b4da74a
fix(www): fix paragraph bug in jsx flow in docs
matuzalemsteles Jan 22, 2025
a5f5862
feat(www): Add CSS category documents
matuzalemsteles Jan 22, 2025
0680b94
fix(www): fixes bug when not pre-rendering blog pages
matuzalemsteles Jan 22, 2025
701589a
chore(www): configure the build for static export and deployment to N…
matuzalemsteles Jan 29, 2025
f6d81a9
chore: remove unnecessary files
matuzalemsteles Jan 29, 2025
7bb0bf6
docs(@clayui/core): migrate LanguagePicker documentation to the new site
matuzalemsteles Jan 29, 2025
2dfb3d5
chore: fixes broken links
matuzalemsteles Jan 29, 2025
87e2e9f
chore: fix lint error
matuzalemsteles Jan 29, 2025
30a8bd7
chore(www): add images
matuzalemsteles Jan 29, 2025
45adb4f
fix(www): fixes bug in icon documentation and generates icons at buil…
matuzalemsteles Jan 29, 2025
64ad22c
chore(www): add package status badge
matuzalemsteles Jan 29, 2025
12b4f83
chore(www): remove unnecessary escaping from examples
matuzalemsteles Jan 31, 2025
047075d
fix(www): Fix visual bug of property type and default value
matuzalemsteles Jan 31, 2025
602c8c6
fix(www): fixes visual bug with spacing in design documents
matuzalemsteles Jan 31, 2025
f1ab9ec
chore: fix eslint
matuzalemsteles Jan 31, 2025
fc7ce7f
chore: sort props
matuzalemsteles Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ node_modules
package-lock.json
/packages/clay-css/src/js/**/*.js
packages/generator-clay-component/app/templates
yarn.lock
yarn.lock
.next
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
run: yarn install && cd ./www && yarn install
- name: Lint
run: yarn lint
- name: Types
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ lib
node_modules
*.log
package-lock.json
.env
.gradle
.parcel-cache
.parcel-ci-builds
.parcel-ci-build.json
.parcel-ci-build.json
# Local Netlify folder
.netlify
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ package-lock.json
/packages/clay-css/src/js/**/*.js
/packages/clay-css/src/scss/bootstrap/**/*.scss
/packages/generator-clay-component/app/templates
yarn.lock
yarn.lock
.next
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"repository": "https://github.com/liferay/clay",
"engines": {
"node": ">=18"
"node": "18.x"
},
"size-limit": [
{
Expand All @@ -21,7 +21,7 @@
"checkDeps": "turbo run build --filter=@clayui/* && node scripts/check-deps/check-dependencies.js",
"ci": "yarn lint && yarn format:check && yarn test && yarn checkDeps",
"coverage": "jest --coverage",
"format": "prettier --write \"**/*.{js,ts,tsx,md,mdx,json,scss}\"",
"format": "prettier --write \"**/*.{js,ts,mjs,tsx,md,mdx,json,scss}\"",
"format:all": "yarn lint:fix && yarn format",
"format:changed": "git ls-files -mz \"*.js\" \"**/*.js\" \"**/*.ts\" \"**/*.tsx\" \"*.md\" \"**/*.md\" \"**/*.mdx\" \"*.json\" \"**/*.json\" \"**/*.scss\" | xargs -0 prettier --write --",
"format:check": "prettier --list-different -- \"**/*.{js,ts,tsx,md,mdx,json,scss}\"",
Expand All @@ -35,7 +35,7 @@
"lint:fix": "eslint --fix \".*.js\" \"**/*.{js,ts,tsx}\"",
"lint:quiet": "eslint --quiet \".*.js\" \"**/*.{js,ts,tsx}\"",
"lint:typescript": "tsc --project ./tsconfig.global.json",
"lint": "eslint \".*.js\" \"**/*.{js,ts,tsx}\"",
"lint": "eslint \".*.js\" \"!(www)/**/*.{js,ts,tsx}\"",
"site": "cd clayui.com && yarn build && yarn serve",
"sizeLimit": "size-limit",
"storybook:build": "NODE_OPTIONS=--max_old_space_size=8192 build-storybook -c .storybook -o .storybook-static",
Expand Down Expand Up @@ -128,5 +128,8 @@
"js-beautify": "1.7.5",
"event-stream": "3.3.4",
"graceful-fs": "^4.2.4"
},
"dependencies": {
"next": "^14.2.5"
}
}
251 changes: 219 additions & 32 deletions packages/clay-alert/docs/alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,247 @@ title: 'Alerts'
description: 'Alerts are used to capture the attention of the user in an intrusive way.'
lexiconDefinition: 'https://liferay.design/lexicon/core-components/alerts/'
packageNpm: '@clayui/alert'
packageUse: "import Alert from '@clayui/alert';"
packageTypes:
[
'clay-alert/src/index.tsx',
'clay-alert/src/Footer.tsx',
'clay-alert/src/ToastContainer.tsx',
]
---

import {
Alert,
AlertIcon,
AlertToastContainer,
AlertVariants,
AlertWithButton,
InlineAlert,
} from '$packages/clay-alert/docs/index';
## Display Types

<div class="nav-toc-absolute">
<div class="nav-toc">
The available `displayTypes` are `info`, `secondary`, `success`, `warning`, and `danger`.

- [Display Types](#alert-display-types)
- [Variants](#variants)
- [Icons](#alert-icons)
- [Using with ClayButton](#using-with-claybutton)
- [Inline](#inline)
- [Using with ToastContainer](#using-with-toastcontainer)
```jsx preview
import {Provider} from '@clayui/core';
import Alert from '@clayui/alert';
import React from 'react';

</div>
</div>
import '@clayui/css/lib/css/atlas.css';

## Display Types(#alert-display-types)
export default function App() {
return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<Alert displayType="info" title="Info" role={null}>
This is an info message.
</Alert>

The available `displayTypes` are `info`, `secondary`, `success`, `warning`, and `danger`.
<Alert displayType="success" title="Success" role={null}>
This is a success message.
</Alert>

<Alert displayType="warning" title="Warning" role={null}>
This is a warning message.
</Alert>

<Alert />
<Alert displayType="danger" title="Danger" role={null}>
This is a danger message.
</Alert>
</div>
</Provider>
);
}
```

We recommend that you review the use cases in the <a href="https://storybook.clayui.com/?path=/story/design-system-components-alert--default">Storybook</a>.
We recommend that you review the use cases in the [Storybook](https://storybook.clayui.com/?path=/story/design-system-components-alert--default).

## Variants

You can use alert with the `feedback`, `inline`, and `stripe` variants.

<AlertVariants />

## Icons(#alert-icons)
```jsx preview
import {Provider, Button} from '@clayui/core';
import Alert from '@clayui/alert';
import React from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<div className="c-mt-3">
<Alert
actions={
<Button.Group spaced>
<Button displayType="warning" small>
Replace
</Button>
<Button alert>Keep Both</Button>
</Button.Group>
}
displayType="warning"
onClose={() => {}}
title="Alert"
variant="inline"
>
A file with this name already exists.
</Alert>
</div>

<Alert
displayType="info"
title="Info"
variant="stripe"
role={null}
>
This is a stripe variant.
</Alert>

<div className="c-mt-3">
<Alert
displayType="success"
title="This is an inline variant."
variant="inline"
role={null}
/>
</div>

<div className="c-mt-3">
<Alert
displayType="danger"
title="This is a feedback variant."
variant="feedback"
role={null}
/>
</div>
</div>
</Provider>
);
}
```

## Icons

Each Alert `displayType` has a default icon, the icon can be changed through the `symbol` attribute.

<AlertIcon />

## Using with ClayButton

<AlertWithButton />
```jsx preview
import {Provider} from '@clayui/core';
import Alert from '@clayui/alert';
import React from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<Alert
displayType="info"
symbol="thumbs-up-full"
title="Info"
variant="stripe"
role={null}
>
This is a stripe variant.
</Alert>
</div>
</Provider>
);
}
```

## Using with Button

```jsx preview
import {Provider, Button} from '@clayui/core';
import Alert from '@clayui/alert';
import React from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<Alert displayType="info" title="With a Button" role={null}>
This is an alert with a button!
<Alert.Footer>
<Button alert>View</Button>
</Alert.Footer>
</Alert>
</div>
</Provider>
);
}
```

### Inline

<InlineAlert />
```jsx preview
import {Provider, Button} from '@clayui/core';
import Alert from '@clayui/alert';
import React from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<Alert
actions={<Button alert>View</Button>}
displayType="info"
title="With a Button"
variant="inline"
role={null}
>
This is an alert with a button!
</Alert>
</div>
</Provider>
);
}
```

## Using with ToastContainer

You can use alerts with a `ToastContainer` to render the alerts in a container with `position: fixed`.

<AlertToastContainer />
```jsx preview
import {Provider, Button} from '@clayui/core';
import Alert from '@clayui/alert';
import React, {useState} from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
const [toastItems, setToastItems] = useState([]);

return (
<Provider spritemap="/public/icons.svg">
<div className="p-4">
<div>
<Button
onClick={() =>
setToastItems([...toastItems, Math.random() * 100])
}
>
Add Alert
</Button>
</div>

<Alert.ToastContainer>
{toastItems.map((value) => (
<Alert
autoClose={5000}
key={value}
onClose={() => {
setToastItems((prevItems) =>
prevItems.filter((item) => item !== value)
);
}}
title="Hola:"
>
My value is {value}
</Alert>
))}
</Alert.ToastContainer>
</div>
</Provider>
);
}
```
Loading
Loading