Aller au contenu principal

IconButton Component

Description

The IconButton component is a button wrapper specifically for icons, offering:

  • Customizable icon size
  • Disabled and selected states
  • Hover effects with scaling animation

Props

PropTypeDefaultDescription
iconReact.ElementType-Icon component to display inside the button.
isSelectedbooleanfalseDetermines if the button is selected.
size"small" , "medium" , "large""medium"Defines the icon size.
disabledbooleanfalseDisables the button when set to true.
componentElementType"button"Allows rendering a different HTML element.

Example Usage

import { IconButton } from "@nomana-it/liberty-core"
import { LYThumbUpIcon, LYThumbDownOffIcon } from "@ly_styles/icons";

export const IconButtonExample = () => {
return (
<div style={{ display: "flex", gap: "16px" }}>
<IconButton icon={LYThumbUpIcon} size="large" />
<IconButton icon={LYThumbDownOffIcon} />
<IconButton icon={LYThumbUpIcon} isSelected />
<IconButton icon={LYThumbDownOffIcon} disabled />
</div>
);
};

🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core