Skip to content

Commit 7971e5c

Browse files
authored
Merge pull request #99 from afnanhussain2002/feat/play-button
feat(components): add PlayButton component with demo and docs
2 parents 2470465 + a3e3bee commit 7971e5c

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
import PlayButton from "./play-button";
3+
4+
5+
const PlayButtonDemo = () => {
6+
return (
7+
<div className="flex items-center justify-center min-h-[30rem]">
8+
<PlayButton text="Play Now" />
9+
</div>
10+
);
11+
};
12+
13+
export default PlayButtonDemo;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import { FaPlay } from 'react-icons/fa';
3+
4+
const PlayButton = ({ text }: { text: string }) => {
5+
return (
6+
<button className="relative group text-white transition-all flex items-center justify-center whitespace-nowrap rounded-lg hover:rotate-[3deg] will-change-transform duration-300 shadow-lg hover:shadow-xl h-14 text-lg pl-[5rem] pr-6 bg-fuchsia-950 shadow-fuchsia-950/30 hover:shadow-fuchsia-950/30">
7+
<div className="absolute left-0 top-0 mt-1 ml-1 bg-white text-fuchsia-950 p-[0.35rem] bottom-1 group-hover:w-[calc(100%-0.5rem)] transition-all rounded-md duration-300 h-12 w-12 flex items-center justify-center">
8+
<FaPlay className="h-6 w-6" />
9+
</div>
10+
<div>{text}</div>
11+
</button>
12+
);
13+
};
14+
15+
export default PlayButton;

src/content/docs/play-button.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "Play Button"
3+
description: "A stylish play button component with indigo glow and animation effects."
4+
---
5+
6+
<ComponentPreview componentName="PlayButton" />
7+
8+
## Installation
9+
10+
<Tabs defaultValue="cli">
11+
12+
<TabsList>
13+
<TabsTrigger value="cli">CLI</TabsTrigger>
14+
<TabsTrigger value="manual">Manual</TabsTrigger>
15+
</TabsList>
16+
17+
<TabsContent value="cli">
18+
<Cli />
19+
</TabsContent>
20+
21+
<TabsContent value="manual">
22+
<Steps>
23+
<Step>Install dependencies</Step>
24+
<Cli
25+
dependencies={[
26+
{ label: "npm", command: "npm i react-icons" },
27+
{ label: "yarn", command: "yarn add react-icons" },
28+
]}
29+
/>
30+
<Step>Copy and paste the following code into your project.</Step>
31+
`components/nurui/play-button.tsx`
32+
<CodeBlock componentName="PlayButton" fileName="play-button" />
33+
</Steps>
34+
</TabsContent>
35+
36+
</Tabs>
37+
38+
### Props
39+
40+
| Prop | Type | Default | Description |
41+
|----------|----------|---------------|-------------------------------|
42+
| `text` | `string` | `"Play demo"` | The text displayed on button |
43+
| ...props | `button` || Standard button props |

src/registry/component-navigation.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const navigation = [
9696
{ name: "Shadow", href: `${baseUrl}/shadow-button` },
9797
{ name: "Text", href: `${baseUrl}/text-button` },
9898
{ name: "future", href: `${baseUrl}/future-button` },
99+
{ name: "Play", href: `${baseUrl}/play-button` },
99100
],
100101
},
101102
// cards

src/registry/components-registry.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import TextFallButtonCode from "@/components/nurui/text-button.tsx?raw";
1313
import MagnetButtonDemo from "@/components/nurui/magnet-button-demo";
1414
import MagnetButtonDemoCode from "@/components/nurui/magnet-button-demo.tsx?raw";
1515
import MagnetButtonCode from "@/components/nurui/magnet-button.tsx?raw";
16+
import PlayButtonDemoCode from "@/components/nurui/play-button-demo.tsx?raw";
17+
import PlayButtonDemo from "@/components/nurui/play-button-demo";
18+
import PlayButtonCode from "@/components/nurui/play-button.tsx?raw";
1619
import PlayingCardDemo from "@/components/nurui/playing-card-demo";
1720
import PlayingCardDemoCode from "@/components/nurui/playing-card-demo.tsx?raw";
1821
import PlayingCardCode from "@/components/nurui/playing-card.tsx?raw";
@@ -193,6 +196,7 @@ import HoverFooterCode from "@/components/nurui/hover-footer.tsx?raw";
193196
import TextHoverEffectCode from "@/components/nurui/text-hover-effect.tsx?raw";
194197
import FooterBackgroundGradient from "@/components/nurui/footer-background-gradient.tsx?raw";
195198

199+
196200
type CodeEntry = {
197201
fileName: string;
198202
code: string;
@@ -357,6 +361,13 @@ export const Index: Record<string, ComponentEntry> = {
357361
{ fileName: "future-frame", code: FrameCode },
358362
],
359363
},
364+
PlayButton: {
365+
preview: <PlayButtonDemo />,
366+
code: PlayButtonDemoCode,
367+
othersCode: [
368+
{ fileName: "play-button", code: PlayButtonCode }
369+
],
370+
},
360371
// cards
361372
playingCard: {
362373
preview: <PlayingCardDemo />,

0 commit comments

Comments
 (0)