-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
146 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<div className="flex flex-wrap gap-4"> | ||
<Snippet color="default">npm install @nextui-org/react</Snippet> | ||
<Snippet color="primary">npm install @nextui-org/react</Snippet> | ||
<Snippet color="secondary">npm install @nextui-org/react</Snippet> | ||
<Snippet color="success">npm install @nextui-org/react</Snippet> | ||
<Snippet color="warning">npm install @nextui-org/react</Snippet> | ||
<Snippet color="danger">npm install @nextui-org/react</Snippet> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export const CopyIcon = ({size, height, width, ...props}) => { | ||
return ( | ||
<svg | ||
fill="none" | ||
height={size || height || 20} | ||
shapeRendering="geometricPrecision" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
viewBox="0 0 24 24" | ||
width={size || width || 20} | ||
{...props} | ||
> | ||
<path d="M6 17C4.89543 17 4 16.1046 4 15V5C4 3.89543 4.89543 3 6 3H13C13.7403 3 14.3866 3.4022 14.7324 4M11 21H18C19.1046 21 20 20.1046 20 19V9C20 7.89543 19.1046 7 18 7H11C9.89543 7 9 7.89543 9 9V19C9 20.1046 9.89543 21 11 21Z" /> | ||
</svg> | ||
); | ||
}; | ||
|
||
export const CheckIcon = ({size, height, width, ...props}) => { | ||
return ( | ||
<svg | ||
fill="currentColor" | ||
height={size || height || 24} | ||
viewBox="0 0 24 24" | ||
width={size || width || 24} | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path d="m2.394 13.742 4.743 3.62 7.616-8.704-1.506-1.316-6.384 7.296-3.257-2.486zm19.359-5.084-1.506-1.316-6.369 7.279-.753-.602-1.25 1.562 2.247 1.798z" /> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default function App() { | ||
return ( | ||
<Snippet checkIcon={<CheckIcon />} copyIcon={<CopyIcon />} variant="bordered"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
apps/docs/content/components/snippet/custom-tooltip.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<Snippet | ||
tooltipProps={{ | ||
color: "foreground", | ||
content: "Copy this snippet", | ||
disableAnimation: true, | ||
placement: "right", | ||
closeDelay: 0, | ||
}} | ||
> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<Snippet> | ||
<span>npm install @nextui-org/react</span> | ||
<span>yarn add @nextui-org/react</span> | ||
<span>pnpm add @nextui-org/react</span> | ||
</Snippet> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<div className="flex flex-wrap gap-4"> | ||
<Snippet size="sm">npm install @nextui-org/react</Snippet> | ||
<Snippet size="md">npm install @nextui-org/react</Snippet> | ||
<Snippet size="lg">npm install @nextui-org/react</Snippet> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<Snippet symbol="#" variant="bordered"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return <Snippet>npm install @nextui-org/react</Snippet>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<div className="flex flex-wrap gap-4"> | ||
<Snippet variant="bordered">npm install @nextui-org/react</Snippet> | ||
<Snippet color="warning" variant="flat"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
<Snippet color="primary" variant="solid"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
<Snippet color="secondary" variant="shadow"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {Snippet} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<Snippet hideCopyButton color="primary" variant="solid"> | ||
npm install @nextui-org/react | ||
</Snippet> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters