tabler-react-2 0.1.76 → 0.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/badge/index.js +3 -4
  2. package/dist/breadcrumb/index.js +2 -1
  3. package/dist/button/index.js +2 -1
  4. package/dist/steps/index.js +3 -4
  5. package/dist/util/flex.js +6 -3
  6. package/docs/LICENSE +21 -0
  7. package/docs/README.md +61 -0
  8. package/docs/gatsby-config.js +54 -0
  9. package/docs/package-lock.json +23315 -0
  10. package/docs/package.json +36 -0
  11. package/docs/src/@rocketseat/gatsby-theme-docs/components/Logo.js +31 -0
  12. package/docs/src/components/ColorSwatch.jsx +22 -0
  13. package/docs/src/components/Excerpt.jsx +28 -0
  14. package/docs/src/components/Margin.jsx +13 -0
  15. package/docs/src/components/Tabler.jsx +48 -0
  16. package/docs/src/config/sidebar.yml +36 -0
  17. package/docs/src/docs/components/alerts.mdx +105 -0
  18. package/docs/src/docs/components/avatar.mdx +259 -0
  19. package/docs/src/docs/components/badges.mdx +190 -0
  20. package/docs/src/docs/components/cards.mdx +245 -0
  21. package/docs/src/docs/components/hr.mdx +68 -0
  22. package/docs/src/docs/components/typography.mdx +173 -0
  23. package/docs/src/docs/faq.mdx +35 -0
  24. package/docs/src/docs/getting-started.mdx +79 -0
  25. package/docs/src/docs/todo.md +5 -0
  26. package/docs/src/docs/utilities/colors.mdx +114 -0
  27. package/docs/src/docs/utilities/margins.mdx +90 -0
  28. package/docs/src/home/index.mdx +23 -0
  29. package/docs/src/pages/404.js +18 -0
  30. package/docs/src/yamlFiles/letters.yml +3 -0
  31. package/docs/static/banner.png +0 -0
  32. package/docs/static/favicon.png +0 -0
  33. package/docs/static/tabler.replaced.css +23191 -0
  34. package/package.json +1 -1
  35. /package/{docs → static-docs}/assets/index-BGz0WjR_.css +0 -0
  36. /package/{docs → static-docs}/assets/index-BzTYsikY.js +0 -0
  37. /package/{docs → static-docs}/index.html +0 -0
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "gatsby-starter-rocketdocs",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "description": "Out of the box Gatsby Starter for creating documentation websites easily and quickly. With support for MDX, code highlight, Analytics, SEO and more",
6
+ "author": "João Pedro Schmitz <hey@joaopedro.dev> (@jpedroschmitz)",
7
+ "license": "MIT",
8
+ "starter-name": "gatsby-starter-rocketdocs",
9
+ "dependencies": {
10
+ "@rocketseat/gatsby-theme-docs": "^4.0.0",
11
+ "ajv": "^8.17.1",
12
+ "gatsby": "^5.9.0",
13
+ "gatsby-plugin-canonical-urls": "^5.9.0",
14
+ "gatsby-plugin-google-analytics": "^5.9.0",
15
+ "gatsby-plugin-manifest": "^5.9.0",
16
+ "gatsby-plugin-offline": "^6.9.0",
17
+ "gatsby-plugin-remove-trailing-slashes": "^4.2.0",
18
+ "gatsby-plugin-sitemap": "^6.9.0",
19
+ "prop-types": "^15.8.1",
20
+ "react": "^18.2.0",
21
+ "react-dom": "^18.2.0",
22
+ "styled-components": "^6.1.15",
23
+ "tabler-react-2": "^0.1.77"
24
+ },
25
+ "devDependencies": {},
26
+ "keywords": [
27
+ "gatsby",
28
+ "gatsby-starter"
29
+ ],
30
+ "scripts": {
31
+ "build": "gatsby build",
32
+ "start": "gatsby develop",
33
+ "serve": "gatsby serve",
34
+ "clean": "gatsby clean"
35
+ }
36
+ }
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+
3
+ export default function Logo(props) {
4
+ return (
5
+ <svg
6
+ width="120"
7
+ height="32"
8
+ viewBox="0 0 120 32"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ {...props}
12
+ >
13
+ <path
14
+ d="M78.2632 10.9573C79.4211 10.9573 80.4737 11.2731 81.4211 11.8521C82.3684 12.4837 83.1579 13.3258 83.6316 14.3258C84.2105 15.431 84.4737 16.6942 84.4737 17.9573C84.4737 19.3258 84.2105 20.4837 83.6842 21.5889C83.2105 22.5889 82.4211 23.4837 81.4737 24.1152C80.5263 24.6942 79.4737 25.01 78.3684 25.01C77.5789 25.01 76.7895 24.8521 76.1053 24.5363C75.4211 24.2205 74.8421 23.8521 74.3158 23.3258V23.4837C74.3158 23.9047 74.1579 24.2731 73.8947 24.5889C73.6316 24.9047 73.2632 25.01 72.7895 25.01C72 25.01 71.3158 24.3784 71.2632 23.5889V7.53629C71.2632 7.11524 71.4211 6.74682 71.6842 6.43103C71.9474 6.11524 72.3684 5.95734 72.7895 6.00997C73.2105 6.00997 73.5789 6.16787 73.8947 6.43103C74.1579 6.74682 74.3158 7.11524 74.3158 7.53629V12.7994C74.7895 12.2205 75.3684 11.7994 76 11.4837C76.6842 11.1152 77.4737 10.9573 78.2632 10.9573ZM51.7368 21.8521C51.9474 21.8521 52.2105 21.9573 52.3684 22.1679C52.5789 22.3784 52.6842 22.6942 52.6842 23.0626C52.6842 23.5363 52.4211 23.9047 51.9474 24.2205C51.4737 24.5363 50.8947 24.6942 50.2632 24.6942C49.3158 24.7468 48.4211 24.4837 47.6316 24.01C46.8947 23.5889 46.5789 22.5889 46.5789 21.1679V14.2205H45.4211C44.6842 14.2731 44.0526 13.6416 44 12.9047V12.7994C44 12.431 44.1579 12.0626 44.4211 11.7994C44.6842 11.5363 45.0526 11.431 45.4211 11.431H46.5789V9.79945C46.5789 9.37839 46.7368 9.00997 47 8.69418C47.2632 8.37839 47.6842 8.2205 48.1053 8.27313C48.5263 8.27313 48.8947 8.43103 49.1579 8.69418C49.4211 9.00997 49.5789 9.37839 49.5789 9.79945V11.431H51.3684C52.1053 11.3784 52.7368 12.01 52.7895 12.7468V12.8521C52.7895 13.5889 52.1579 14.2205 51.4211 14.2205H49.5789V21.0626C49.5789 21.431 49.6842 21.6942 49.8421 21.8521C50.0526 22.01 50.2632 22.1152 50.5789 22.1152C50.6873 22.1152 50.7956 22.0905 50.938 22.0579C51.0031 22.043 51.0753 22.0265 51.1579 22.01C51.3684 21.9047 51.5263 21.8521 51.7368 21.8521ZM66.4737 10.9573C67.2632 10.9573 67.9474 11.5889 68 12.3784V23.1679C68 23.5889 67.8421 23.9573 67.5789 24.2731C67.3158 24.5889 66.9474 24.6942 66.4737 24.6942C66.0526 24.6942 65.6842 24.5363 65.4211 24.2731C65.1579 23.9573 65 23.5889 65 23.1679C64.5263 23.6942 63.9474 24.1152 63.3158 24.431C62.6316 24.7468 61.8421 24.9573 61.0526 24.9573C59.8947 24.9573 58.8421 24.6416 57.8947 24.0626C56.9474 23.431 56.1579 22.5889 55.6842 21.5889C55.1157 20.4637 54.8268 19.218 54.8421 17.9573C54.8421 16.5889 55.1053 15.431 55.6316 14.3258C56.1053 13.3258 56.8947 12.431 57.8421 11.7994C58.7895 11.2205 59.8421 10.9047 60.9474 10.9047C62.4737 10.9047 63.8947 11.431 65 12.4837C65 12.0626 65.1579 11.6942 65.4211 11.3784C65.6842 11.0626 66.0526 10.9047 66.4737 10.9573ZM64.0526 20.9573C64.7386 20.1085 65.1105 19.0487 65.1053 17.9573C65.1053 16.7468 64.7368 15.7468 64.0526 14.9047C63.396 14.1043 62.4031 13.6565 61.3684 13.6942C60.2632 13.6942 59.4211 14.1152 58.7368 14.9047C58.0526 15.7468 57.6842 16.8521 57.6842 17.9573C57.6842 19.1679 58.0526 20.1679 58.6842 20.9573C59.3684 21.7468 60.3684 22.2205 61.3684 22.1679C62.4737 22.1679 63.3684 21.7468 64.0526 20.9573ZM80.5263 20.9573C81.2105 20.1152 81.5789 19.01 81.5789 17.9047C81.5789 16.6942 81.2632 15.6942 80.5789 14.9047C79.9139 14.1152 78.9267 13.67 77.8947 13.6942C76.7895 13.6942 75.8947 14.1152 75.2105 14.9047C74.532 15.7577 74.1611 16.8147 74.1579 17.9047C74.1579 19.1152 74.4737 20.1152 75.2105 20.9573C75.8947 21.7468 76.8947 22.2205 77.8947 22.1679C79 22.1679 79.8421 21.7468 80.5263 20.9573ZM90.3158 23.1679C90.3158 23.5889 90.1579 23.9573 89.8947 24.2731C89.6316 24.5889 89.2105 24.6942 88.7895 24.6942C88.3684 24.6942 88 24.5363 87.7368 24.2731C87.4737 23.9573 87.3158 23.5889 87.3158 23.1679V7.53629C87.3158 7.11524 87.4737 6.74682 87.7368 6.43103C88.0526 6.11524 88.4211 5.95734 88.8421 6.00997C89.2632 6.00997 89.6316 6.16787 89.8947 6.43103C90.2105 6.74682 90.3158 7.11524 90.3158 7.53629V23.1679ZM105.263 18.6416C105.579 18.3784 105.737 18.0626 105.737 17.6416C105.737 15.2731 104.474 13.0626 102.632 11.7994C101.632 11.2205 100.579 10.9047 99.4737 10.9047C98.3158 10.9047 97.2632 11.2205 96.2632 11.7994C95.2105 12.431 94.4211 13.2731 93.8421 14.3258C93.2632 15.3784 92.9474 16.6416 92.9474 18.1152C92.8947 19.3784 93.2105 20.5889 93.7895 21.6416C94.3684 22.6416 95.1579 23.4837 96.2105 24.0626C97.2632 24.6416 98.4737 24.9573 99.8947 24.9573C100.737 24.9573 101.526 24.7994 102.316 24.5363C103.105 24.2731 103.737 23.9047 104.211 23.5363C104.684 23.2205 104.895 22.7994 104.895 22.3258C104.895 21.9573 104.789 21.6942 104.526 21.431C104.263 21.1679 104 21.0626 103.632 21.0626C103.368 21.0626 103.053 21.1152 102.789 21.2731L102.316 21.5363C102 21.7468 101.684 21.8521 101.368 21.9573C100.947 22.1152 100.421 22.1679 99.7368 22.1679C97.8421 22.2205 96.2105 20.8521 95.8947 19.01H104.211C104.632 19.01 104.947 18.9047 105.263 18.6416ZM99.3158 13.6942C100.105 13.6942 100.842 13.9573 101.421 14.431C102 14.9047 102.421 15.5363 102.474 16.2731V16.431H95.8421C96.2105 14.5889 97.3684 13.6942 99.3158 13.6942ZM116.526 11.3784C116.211 11.1152 115.789 10.9573 115.263 10.9573C114.474 10.9573 113.684 11.1152 113 11.4837C112.263 11.8521 111.684 12.3784 111.316 13.0626V12.7468C111.316 12.3258 111.211 11.9573 110.895 11.6416C110.579 11.3784 110.211 11.2205 109.789 11.2205C109.368 11.1679 108.947 11.3258 108.684 11.6416C108.421 11.9573 108.263 12.3258 108.263 12.7468V23.1152C108.263 23.5363 108.421 23.9047 108.684 24.2205C109 24.4837 109.316 24.6416 109.789 24.6416C110.263 24.6416 110.632 24.5363 110.895 24.2205C111.158 23.9047 111.316 23.5363 111.316 23.1152V17.1152C111.263 16.431 111.421 15.7994 111.684 15.1679C111.895 14.6942 112.263 14.2731 112.684 13.9573C113.211 13.5889 113.895 13.4837 114.526 13.6416L114.842 13.7468C115.158 13.8521 115.421 13.9047 115.684 13.9047C116.053 13.9573 116.368 13.7994 116.632 13.5363C116.947 13.2731 117.053 12.9047 117.053 12.3784C117.053 12.01 116.842 11.6416 116.526 11.3784Z"
15
+ fill="#000427"
16
+ />
17
+ <path
18
+ d="M31.2881 7.10695C30.4887 3.95941 28.0406 1.51132 24.8931 0.711944C18.9977 -0.237315 13.0023 -0.237315 7.10695 0.711944C3.95941 1.51132 1.51132 3.95941 0.711944 7.10695C-0.237315 13.0023 -0.237315 18.9977 0.711944 24.8931C1.51132 28.0406 3.95941 30.4887 7.10695 31.2881C13.0023 32.2373 18.9977 32.2373 24.8931 31.2881C28.0406 30.4887 30.4887 28.0406 31.2881 24.8931C32.2373 18.9977 32.2373 13.0023 31.2881 7.10695Z"
19
+ fill="#066FD1"
20
+ />
21
+ <path
22
+ d="M10.0186 22.452C12.2477 21.065 14.13 19.1827 15.517 17.0031C15.9628 16.3096 15.9628 15.3684 15.517 14.6749C14.0805 12.4954 12.2477 10.6625 10.0186 9.27555C8.92878 8.58205 7.49225 8.97834 6.79875 10.0681C6.74922 10.0681 6.74922 10.1177 6.74922 10.1177C6.44515 10.6427 6.36306 11.2674 6.52113 11.8532C6.67921 12.439 7.06439 12.9376 7.59132 13.2384C8.73064 13.9814 9.72135 14.8235 10.613 15.8638C9.77089 16.904 8.73064 17.7957 7.59132 18.4892C6.84829 18.8855 6.40247 19.678 6.40247 20.5201C6.44817 21.3569 6.9275 22.1091 7.66667 22.504C8.40585 22.8989 9.29757 22.8792 10.0186 22.452Z"
23
+ fill="white"
24
+ />
25
+ <path
26
+ d="M17.7461 21.8081H23.3932C24.4334 21.8081 25.2755 21.3127 25.2755 20.322C25.2755 19.3313 24.4334 18.8359 23.3932 18.8359H17.7461C16.7059 18.8359 15.8638 19.3313 15.8638 20.322C15.8638 21.3127 16.7059 21.8081 17.7461 21.8081Z"
27
+ fill="white"
28
+ />
29
+ </svg>
30
+ );
31
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { Tabler } from "./Tabler";
3
+
4
+ export const ColorSwatch = ({ colorName, fg = "black" }) => {
5
+ return (
6
+ <Tabler>
7
+ <div
8
+ className={`bg-${colorName}`}
9
+ style={{
10
+ width: 100,
11
+ height: 50,
12
+ color: fg,
13
+ display: "flex",
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ }}
17
+ >
18
+ {colorName}
19
+ </div>
20
+ </Tabler>
21
+ );
22
+ };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+ import { Tabler } from "./Tabler";
4
+
5
+ const _Excerpt = styled.div`
6
+ background: white;
7
+ background-image: radial-gradient(#e4e4e4 1px, transparent 0);
8
+ background-size: 20px 20px;
9
+ background-position: -19px -19px;
10
+ border: 1.5px solid #e4e4e4;
11
+ border-radius: 8px;
12
+ min-height: 100px;
13
+ width: 100%;
14
+ padding: 16px;
15
+ display: flex;
16
+ flex-direction: row;
17
+ align-items: center;
18
+ justify-content: center;
19
+ margin-bottom: 16px;
20
+ `;
21
+
22
+ export const Excerpt = ({ children }) => {
23
+ return (
24
+ <_Excerpt>
25
+ <Tabler>{children}</Tabler>
26
+ </_Excerpt>
27
+ );
28
+ };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+
3
+ export const Margin = ({ className, children }) => {
4
+ return (
5
+ <div
6
+ style={{ background: "#00ddff58", border: "0.01px solid transparent" }}
7
+ >
8
+ <div className={className}>
9
+ <div style={{ background: "#ff000057" }}>{className}</div>
10
+ </div>
11
+ </div>
12
+ );
13
+ };
@@ -0,0 +1,48 @@
1
+ import React, { useEffect, useRef, useState } from "react";
2
+ import ReactDOM from "react-dom";
3
+
4
+ export const Tabler = ({ children }) => {
5
+ const containerRef = useRef(null);
6
+ const shadowRef = useRef(null);
7
+ const [wrapper, setWrapper] = useState(null);
8
+
9
+ useEffect(() => {
10
+ if (containerRef.current && !shadowRef.current) {
11
+ if (typeof window !== "undefined") {
12
+ shadowRef.current = containerRef.current.attachShadow({ mode: "open" });
13
+
14
+ // Load local Tabler styles
15
+ const styleLink = document.createElement("link");
16
+ styleLink.rel = "stylesheet";
17
+ styleLink.href = "/tabler.replaced.css"; // Ensure the path is correct
18
+
19
+ // Create a wrapper div for children
20
+ const wrapperDiv = document.createElement("div");
21
+ wrapperDiv.style.display = "inline-block";
22
+ wrapperDiv.style.width = "auto";
23
+ wrapperDiv.style.height = "auto";
24
+
25
+ // Inject Tabler scripts
26
+ const script = document.createElement("script");
27
+ script.src =
28
+ "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta17/dist/js/tabler.min.js";
29
+
30
+ const inlineScript = document.createElement("script");
31
+ inlineScript.textContent = "window?.USE_FALLBACK_ANCHOR = true;";
32
+
33
+ shadowRef.current.appendChild(styleLink);
34
+ shadowRef.current.appendChild(wrapperDiv);
35
+ shadowRef.current.appendChild(script);
36
+ shadowRef.current.appendChild(inlineScript);
37
+
38
+ setWrapper(wrapperDiv);
39
+ }
40
+ }
41
+ }, []);
42
+
43
+ return (
44
+ <div ref={containerRef}>
45
+ {wrapper && ReactDOM.createPortal(children, wrapper)}
46
+ </div>
47
+ );
48
+ };
@@ -0,0 +1,36 @@
1
+ # Sidebar navigation
2
+
3
+ - label: "Introduction"
4
+ link: "/"
5
+ - label: "Getting started"
6
+ link: "/getting-started"
7
+ - label: "Components"
8
+ items:
9
+ - label: "Typography"
10
+ link: "/components/typography"
11
+ - label: "Cards"
12
+ link: "/components/cards"
13
+ - label: "Horizontal Rule"
14
+ link: "/components/hr"
15
+ - label: "Alerts"
16
+ link: "/components/alerts"
17
+ - label: "Avatars"
18
+ link: "/components/avatar"
19
+ - label: "Badges"
20
+ link: "/components/badges"
21
+ - label: "Utilities"
22
+ items:
23
+ - label: "Colors"
24
+ link: "/utilities/colors"
25
+ - label: "Margins"
26
+ link: "/utilities/margins"
27
+ - label: "More"
28
+ items:
29
+ - label: "To do list"
30
+ link: "/todo"
31
+ # - label: More
32
+ # items:
33
+ # - label: FAQ
34
+ # link: /faq
35
+ # - label: "Github"
36
+ # link: https://github.com/jpedroschmitz/rocketdocs
@@ -0,0 +1,105 @@
1
+ ---
2
+ title: Alerts
3
+ ---
4
+
5
+ import { Alert } from "tabler-react-2";
6
+ import { Excerpt } from "../../components/Excerpt.jsx";
7
+
8
+ Alerts are used to display important messages to the user. Not to be confused with toasts.
9
+
10
+ ## Signature
11
+
12
+ ```jsx
13
+ import { Alert } from "tabler-react-2";
14
+
15
+ <Alert {...props}>{children}</Alert>;
16
+ ```
17
+
18
+ ### Props
19
+
20
+ | Prop | Required | Type | Default | Description |
21
+ | ----------- | -------- | -------------------------- | ------- | ---------------------------------------------------------- |
22
+ | `variant` | No | [Color](/utilities/colors) | | The color variant of the alert. |
23
+ | `title` | No | String | | The title of the alert. |
24
+ | `onDismiss` | No | function | | A function that fires when the user clicks a close button. |
25
+ | `icon` | No | `React.ReactNode` | | An icon to be displayed in the alert. |
26
+
27
+ ## Basic Usage
28
+
29
+ The `Alert` component is used to display an alert message.
30
+
31
+ <Excerpt>
32
+ <Alert>This is a basic alert.</Alert>
33
+ </Excerpt>
34
+
35
+ ```jsx
36
+ <Alert>This is a basic alert.</Alert>
37
+ ```
38
+
39
+ ## Variants
40
+
41
+ The `Alert` component can be used to display different types of alerts. The `variant` prop accepts a string value of `success`, `failure`, `warning`, `info`, `danger`, or `dark`.
42
+
43
+ <Excerpt>
44
+ <div
45
+ style={{
46
+ display: "flex",
47
+ flexDirection: "row",
48
+ gap: 10,
49
+ flexWrap: "wrap",
50
+ alignItems: "center",
51
+ }}
52
+ >
53
+ {["success", "failure", "warning", "info", "danger", "dark"].map(
54
+ (variant) => (
55
+ <Alert
56
+ key={variant}
57
+ variant={variant}
58
+ title={variant}
59
+ style={{ maxWidth: 250, minWidth: 150 }}
60
+ >
61
+ {variant} alert
62
+ </Alert>
63
+ )
64
+ )}
65
+ </div>
66
+ </Excerpt>
67
+
68
+ ```jsx
69
+ <Alert variant="success" title="success">
70
+ success alert
71
+ </Alert>
72
+ <Alert variant="failure" title="failure">
73
+ failure alert
74
+ </Alert>
75
+ ```
76
+
77
+ ## Titles
78
+
79
+ You can pass a `title` prop to the `Alert` component to display a title in boldface and the variant color.
80
+
81
+ <Excerpt>
82
+ <Alert title="My awesome title">A card with a title.</Alert>
83
+ </Excerpt>
84
+
85
+ ```jsx
86
+ <Alert title="My awesome title">A card with a title.</Alert>
87
+ ```
88
+
89
+ ## Dismissible Alerts
90
+
91
+ You can pass an `onDismiss` prop to the `Alert` component to display a close button. When the user clicks the close button, the `onDismiss` function is called.
92
+
93
+ <Excerpt>
94
+ <Alert title="Dismissible alert" onDismiss={() => alert("Alert dismissed!")}>
95
+ A dismissible alert.
96
+ </Alert>
97
+ </Excerpt>
98
+
99
+ ```jsx
100
+ <Alert title="Dismissible alert" onDismiss={() => alert("Alert dismissed!")}>
101
+ A dismissible alert.
102
+ </Alert>
103
+ ```
104
+
105
+ > **Note**: The alert component does not manage its own state. If you want the alert to go away when the user clicks the close button, you must unmount it yourself.
@@ -0,0 +1,259 @@
1
+ ---
2
+ title: Avatars
3
+ ---
4
+
5
+ import { Avatar, AvatarStackedList } from "tabler-react-2";
6
+ import { Excerpt } from "../../components/Excerpt.jsx";
7
+
8
+ Avatars are used to display a user's profile picture or initials.
9
+
10
+ ## Signature
11
+
12
+ ```jsx
13
+ import { Avatar } from "tabler-react-2";
14
+
15
+ <Avatar {...props}>{children}</Avatar>;
16
+ ```
17
+
18
+ ### Props
19
+
20
+ | Prop | Required | Type | Default | Description |
21
+ | --------------- | -------- | -------------------------- | ------- | ---------------------------------------- |
22
+ | `src` | No | String | | The URL of the avatar image. |
23
+ | `initials` | No | String | | The initials of the avatar. |
24
+ | `initialsColor` | No | [Color](/utilities/colors) | | The background color of the initials. |
25
+ | `dicebear` | No | String \| Boolean | | The style of the avatar. |
26
+ | `size` | No | [`sm`, `md`, `lg`] | | The size of the avatar. |
27
+ | `status` | No | [Color](/utilities/colors) | | The status of the avatar. |
28
+ | `badge` | No | String | | The badge to be displayed on the avatar. |
29
+ | `color` | No | [Color](/utilities/colors) | | The color of the avatar. |
30
+
31
+ ## Basic Usage
32
+
33
+ The `Avatar` component is used to display an avatar.
34
+
35
+ <Excerpt>
36
+ <Avatar src="https://picsum.photos/200" />
37
+ </Excerpt>
38
+
39
+ ```jsx
40
+ <Avatar src="https://picsum.photos/200" />
41
+ ```
42
+
43
+ ## Initials
44
+
45
+ You can pass an `initials` prop to the `Avatar` component to display initials.
46
+
47
+ <Excerpt>
48
+ <Avatar initials="JC" />
49
+ </Excerpt>
50
+
51
+ ```jsx
52
+ <Avatar initials="JC" />
53
+ ```
54
+
55
+ ## Color
56
+
57
+ You can pass a `color` prop to the `Avatar` component to change the color of the avatar.
58
+
59
+ <Excerpt>
60
+ <div
61
+ style={{ display: "flex", flexDirection: "row", gap: 10, flexWrap: "wrap" }}
62
+ >
63
+ {[
64
+ "primary",
65
+ "secondary",
66
+ "success",
67
+ "danger",
68
+ "warning",
69
+ "info",
70
+ "dark",
71
+ "yellow",
72
+ "pink",
73
+ "purple",
74
+ ].map((color) => (
75
+ <Avatar key={color} initials="JC" color={color} />
76
+ ))}
77
+ </div>
78
+ </Excerpt>
79
+
80
+ ```jsx
81
+ <Avatar initials="JC" color="primary" />
82
+ <Avatar initials="JC" color="secondary" />
83
+ <Avatar initials="JC" color="success" />
84
+ <Avatar initials="JC" color="danger" />
85
+ <Avatar initials="JC" color="warning" />
86
+ ```
87
+
88
+ ## Initials Color
89
+
90
+ > **Note**: Unless explicitly required, you should not use the `initialsColor` prop. Instead, use the `color` prop.
91
+
92
+ You can pass an `initialsColor` prop to the `Avatar` component to change the color of the initials.
93
+
94
+ <Excerpt>
95
+ <Avatar initials="JC" initialsColor="cyan" />
96
+ </Excerpt>
97
+
98
+ ```jsx
99
+ <Avatar initials="JC" initialsColor="cyan" />
100
+ ```
101
+
102
+ ## Dicebear
103
+
104
+ You can use Dicebear to generate avatars. You can pass a `dicebear` attribute to the `Avatar` component to instruct it to use a Dicebear image. Dicebear will use the `initials` prop as a seed. When a dicebear style is not provided, it defaults to `shapes`.
105
+
106
+ <Excerpt>
107
+ <Avatar dicebear initials="JC" />
108
+ </Excerpt>
109
+
110
+ ```jsx
111
+ <Avatar dicebear initials="JC" />
112
+ ```
113
+
114
+ ### Dicebear Styles
115
+
116
+ You can pass a `dicebear` prop to the `Avatar` component to instruct it to use a specific Dicebear style. The `dicebear` prop accepts a string value of the style name or a boolean.
117
+
118
+ ### Dicebear Styles
119
+
120
+ <Excerpt>
121
+ <div
122
+ style={{ display: "flex", flexDirection: "row", gap: 10, flexWrap: "wrap" }}
123
+ >
124
+ {[
125
+ "adventurer",
126
+ "bottts",
127
+ "identicon",
128
+ "initials",
129
+ "croodles",
130
+ "dylan",
131
+ "icons",
132
+ "lorelei",
133
+ ].map((style) => (
134
+ <Avatar key={style} dicebear={style} initials="JC" />
135
+ ))}
136
+ </div>
137
+ </Excerpt>
138
+
139
+ ```jsx
140
+ <Avatar dicebear="bottts" initials="JC" />
141
+ <Avatar dicebear="identicon" initials="JC" />
142
+ <Avatar dicebear="initials" initials="JC" />
143
+ <Avatar dicebear="croodles" initials="JC" />
144
+ <Avatar dicebear="dylan" initials="JC" />
145
+ <Avatar dicebear="icons" initials="JC" />
146
+ <Avatar dicebear="lorelei" initials="JC" />
147
+ ```
148
+
149
+ Styles are at the [Dicebear docs page](https://www.dicebear.com/styles/) and work out-of-the-box.
150
+
151
+ ## Sizes
152
+
153
+ <Excerpt>
154
+ <div
155
+ style={{
156
+ display: "flex",
157
+ flexDirection: "row",
158
+ gap: 10,
159
+ flexWrap: "wrap",
160
+ alignItems: "center",
161
+ }}
162
+ >
163
+ {["sm", "md", "lg"].map((size) => (
164
+ <Avatar key={size} size={size} initials="JC" />
165
+ ))}
166
+ </div>
167
+ </Excerpt>
168
+
169
+ ```jsx
170
+ <Avatar size="sm" initials="JC" />
171
+ <Avatar size="md" initials="JC" />
172
+ <Avatar size="lg" initials="JC" />
173
+ ```
174
+
175
+ ## Statuses
176
+
177
+ You can pass a `status` prop to the `Avatar` component to display a badge on the avatar. The `status` prop accepts a string value [color](/utilities/colors).
178
+
179
+ <Excerpt>
180
+ <div
181
+ style={{
182
+ display: "flex",
183
+ flexDirection: "row",
184
+ gap: 10,
185
+ flexWrap: "wrap",
186
+ alignItems: "center",
187
+ }}
188
+ >
189
+ {[
190
+ "primary",
191
+ "secondary",
192
+ "success",
193
+ "danger",
194
+ "warning",
195
+ "info",
196
+ "dark",
197
+ ].map((status) => (
198
+ <Avatar key={status} status={status} initials="JC" />
199
+ ))}
200
+ </div>
201
+ </Excerpt>
202
+
203
+ ```jsx
204
+ <Avatar status="primary" initials="JC" />
205
+ <Avatar status="secondary" initials="JC" />
206
+ <Avatar status="success" initials="JC" />
207
+ <Avatar status="danger" initials="JC" />
208
+ <Avatar status="warning" initials="JC" />
209
+ <Avatar status="info" initials="JC" />
210
+ <Avatar status="dark" initials="JC" />
211
+ ```
212
+
213
+ ## Badges
214
+
215
+ You can pass a `badge` prop to the `Avatar` component to display a badge on the avatar. Badges require a `status` prop to be present in order to be displayed.
216
+
217
+ <Excerpt>
218
+ <div
219
+ style={{
220
+ display: "flex",
221
+ flexDirection: "row",
222
+ gap: 10,
223
+ flexWrap: "wrap",
224
+ alignItems: "center",
225
+ }}
226
+ >
227
+ {[1, 2, 3, 4, 5].map((badge) => (
228
+ <Avatar key={badge} badge={badge} status="danger" initials="JC" />
229
+ ))}
230
+ </div>
231
+ </Excerpt>
232
+
233
+ ```jsx
234
+ <Avatar badge={1} status="danger" initials="JC" />
235
+ <Avatar badge={2} status="danger" initials="JC" />
236
+ <Avatar badge={3} status="danger" initials="JC" />
237
+ <Avatar badge={4} status="danger" initials="JC" />
238
+ <Avatar badge={5} status="danger" initials="JC" />
239
+ ```
240
+
241
+ ## Stacked Avatars
242
+
243
+ You can use the `AvatarStackedList` component to stack avatars.
244
+
245
+ <Excerpt>
246
+ <AvatarStackedList>
247
+ <Avatar stacked dicebear initials="JC" />
248
+ <Avatar stacked dicebear initials="AB" />
249
+ </AvatarStackedList>
250
+ </Excerpt>
251
+
252
+ ```jsx
253
+ import { Avatar, AvatarStackedList } from "tabler-react-2";
254
+
255
+ <AvatarStackedList>
256
+ <Avatar stacked initials="JC" />
257
+ <Avatar stacked initials="JC" />
258
+ </AvatarStackedList>;
259
+ ```