Skip to content

Commit

Permalink
Make LinkButton available for app UIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jviide committed Aug 5, 2024
1 parent 9920599 commit c67813f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-cherries-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@badrap/libapp": patch
---

Make LinkButton available fro app UIs
23 changes: 23 additions & 0 deletions src/ui/experimental/LinkButton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { UiNode, element, Responsive } from "../internal.js";

type LinkButtonProps = {
href: string;
variant?: "default" | "primary" | "danger";
size?: Responsive<"sm" | "md">;
iconSide?: "start" | "end";
disabled?: boolean;
children?: UiNode;
} & (
| {
icon: `material-symbols:${string}`;
iconOnly?: Responsive<boolean>;
}
| {
icon?: undefined;
iconOnly?: undefined;
}
);

export function LinkButton(props: LinkButtonProps): UiNode {
return element("ui-link-button", props);
}
1 change: 1 addition & 0 deletions src/ui/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { Hidden } from "./Hidden.js";
export { HiddenInput } from "./HiddenInput.js";
export { Icon } from "./Icon.js";
export { Link } from "./Link.js";
export { LinkButton } from "./LinkButton.js";
export { List } from "./List.js";
export { Redirect } from "./Redirect.js";
export { Switch } from "./Switch.js";
Expand Down

0 comments on commit c67813f

Please sign in to comment.