Callout
solid-ui/calloutFreeComponent
A callout component
Live preview
live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solid-ui.com/r/callout.jsonSource
1import type { Component, ComponentProps } from "solid-js"2import { splitProps } from "solid-js"34import type { VariantProps } from "class-variance-authority"5import { cva } from "class-variance-authority"67import { cn } from "~/lib/utils"89const calloutVariants = cva("rounded-md border-l-4 p-2 pl-4", {10 variants: {11 variant: {12 default: "border-info-foreground bg-info text-info-foreground",13 success: "border-success-foreground bg-success text-success-foreground",14 warning: "border-warning-foreground bg-warning text-warning-foreground",15 error: "border-error-foreground bg-error text-error-foreground"16 }17 },18 defaultVariants: {19 variant: "default"20 }21})2223type CalloutProps = ComponentProps<"div"> & VariantProps<typeof calloutVariants>2425const Callout: Component<CalloutProps> = (props) => {26 const [local, others] = splitProps(props, ["class", "variant"])27 return <div class={cn(calloutVariants({ variant: local.variant }), local.class)} {...others} />28}2930const CalloutTitle: Component<ComponentProps<"h3">> = (props) => {31 const [local, others] = splitProps(props, ["class"])32 return <h3 class={cn("font-semibold", local.class)} {...others} />33}3435const CalloutContent: Component<ComponentProps<"div">> = (props) => {36 const [local, others] = splitProps(props, ["class"])37 return <div class={cn("mt-2", local.class)} {...others} />38}3940export { Callout, CalloutTitle, CalloutContent }
What it pulls in
npm packages
Files it writes
More from solid-ui
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | solid-ui | Components | Free | 2 deps | |
| Alertalert | solid-ui | Components | Free | 3 deps | |
| Alert Dialogalert-dialog | solid-ui | Components | Free | 2 deps | |
| Aspect Ratioaspect-ratio | solid-ui | Components | Free | 1 dep | |
| Avataravatar | solid-ui | Components | Free | 2 deps | |
| Badgebadge | solid-ui | Components | Free | 2 deps | |
| Badge Deltabadge-delta | solid-ui | Components | Free | 2 deps | |
| Bar Listbar-list | solid-ui | Components | Free | 1 dep |
