You can edit 8 Components for free. Get premium for unlimited access.
Displays a button or a component that looks like a button.
Preview
Code
DlButtonTimed(
label: 'Resend code',
countdownInSeconds: 10,
onPressed: () {
// Called at 0:00 when user taps.
// Then timer restarts automatically from 10.
},
),Add this code example to your project to see how the component works.
DlButtonTimed(
label: 'Resend code',
countdownInSeconds: 10,
onPressed: () {
// Called at 0:00 when user taps.
// Then timer restarts automatically from 10.
},
),DlButtonTimed is a countdown-based button that starts disabled, becomes default at 0:00, and restarts the countdown cycle each time it is pressed.
Variants
Preview
Code
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.lg,
type: DlButtonType.primary,
onPressed: () {},
),
const SizedBox(height: 16),
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.lg,
type: DlButtonType.secondary,
onPressed: () {},
),
const SizedBox(height: 16),
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.lg,
type: DlButtonType.tertiary,
onPressed: () {},
),
],
)Size
Preview
Code
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.lg,
onPressed: () {},
),
const SizedBox(height: 16),
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.md,
onPressed: () {},
),
const SizedBox(height: 16),
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.sm,
onPressed: () {},
),
const SizedBox(height: 16),
DlButtonTimed(
label: 'Label',
countdownInSeconds: 10,
size: DlButtonSize.xs,
onPressed: () {},
),
],
)Disabled
Preview
Code
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/components/ui/avatar"
export function AvatarDemo() {
return (
<div className="flex flex-row flex-wrap items-center gap-12">
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<Avatar className="rounded-lg">
<AvatarImage
src="https://github.com/evilrabbit.png"
alt="@evilrabbit"
/>
<AvatarFallback>ER</AvatarFallback>
</Avatar>
<div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage src="https://github.com/leerob.png" alt="@leerob" />
<AvatarFallback>LR</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage
src="https://github.com/evilrabbit.png"
alt="@evilrabbit"
/>
<AvatarFallback>ER</AvatarFallback>
</Avatar>
</div>
</div>
)
}You have questions or need help?
You want to try?
Save time and money?