BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solid-ui/delta-bar

Delta Bar

solid-ui/delta-bar
FreeComponent

A delta bar 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/delta-bar.json

Source

src/registry/ui/delta-bar.tsxwww.solid-ui.com/r/delta-bar.json
1import { mergeProps, Show, splitProps, type Component, type ComponentProps } from "solid-js"
2
3import { cn } from "~/lib/utils"
4
5type DeltaBarProps = ComponentProps<"div"> & {
6 value: number
7 isIncreasePositive?: boolean
8}
9
10const DeltaBar: Component<DeltaBarProps> = (rawProps) => {
11 const props = mergeProps(
12 {
13 isIncreasePositive: true
14 },
15 rawProps
16 )
17 const [local, others] = splitProps(props, ["value", "isIncreasePositive", "class"])
18
19 const barColor = () =>
20 (local.value > 0 && local.isIncreasePositive) || (local.value < 0 && !local.isIncreasePositive)
21 ? "bg-success-foreground"
22 : "bg-error-foreground"
23
24 return (
25 <div
26 class={cn("relative flex h-2 w-full items-center rounded-full bg-secondary", local.class)}
27 {...others}
28 >
29 <div class="flex h-full w-1/2 justify-end">
30 <Show when={local.value < 0}>
31 <div
32 class={cn("rounded-l-full", barColor())}
33 style={{ width: `${Math.abs(local.value)}%` }}
34 />
35 </Show>
36 </div>
37 <div class={cn("z-10 h-4 w-1 rounded-full ring-2 ring-background", barColor())} />
38 <div class="flex h-full w-1/2 justify-start">
39 <Show when={local.value > 0}>
40 <div
41 class={cn("rounded-r-full", barColor())}
42 style={{ width: `${Math.abs(local.value)}%` }}
43 />
44 </Show>
45 </div>
46 </div>
47 )
48}
49
50export { DeltaBar }
51export type { DeltaBarProps }
52

What it pulls in

npm packages

  • solid-js

Files it writes

  • src/registry/ui/delta-bar.tsx

Facts

Registry
solid-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solid-ui www.solid-ui.com stefan-karger/solid-ui on GitHub Raw registry item This item as JSON

More from solid-ui

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionsolid-uiComponentsFree2 deps
Alertalertsolid-uiComponentsFree3 deps
Alert Dialogalert-dialogsolid-uiComponentsFree2 deps
Aspect Ratioaspect-ratiosolid-uiComponentsFree1 dep
Avataravatarsolid-uiComponentsFree2 deps
Badgebadgesolid-uiComponentsFree2 deps
Badge Deltabadge-deltasolid-uiComponentsFree2 deps
Bar Listbar-listsolid-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex