Package Exports
- @ezyren/oppr_ui
- @ezyren/oppr_ui/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ezyren/oppr_ui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@ezyren/oppr-ui
Reusable UI components for Oppr.
📜 Table of Contents
Installation
npm install @ezyren/oppr-ui
or
yarn add @ezyren/oppr-ui
Usage
Avatar
import { Avatar } from "@ezyren/oppr_ui";
<Avatar src="https://randomuser.me/api/portraits/men/32.jpg" size="small" />
<Avatar src="https://randomuser.me/api/portraits/women/44.jpg" size="medium" />
<Avatar src="https://randomuser.me/api/portraits/men/56.jpg" size="large" />
<Avatar size="large" /> {/* Default avatar without image */}
BreadCrumbs
import { Breadcrumbs } from "@ezyren/oppr_ui";
const breadcrumbItems = [
{ label: "Home", href: "/" },
{ label: "Components", href: "/components" },
{ label: "Breadcrumbs" },
];
return <Breadcrumbs items={breadcrumbItems} />;Button
import { Button } from "@ezyren/oppr_ui";
return <Button>Click Me</Button>;Card
import { Card } from "@ezyren/oppr_ui";
return <Card title="Card Title" description="This is a sample card description." />;Checkbox
import { Checkbox } from "@ezyren/oppr_ui";
function MyComponent() {
const [isChecked, setIsChecked] = useState(false);
return (
<div>
<Checkbox label="Subscribe to newsletter" checked={isChecked} onChange={setIsChecked} />
{isChecked && <p className="text-green-600">Subscribed!</p>}
</div>
);
}
Dialog
import { Dialog} from "@ezyren/oppr_ui";
function MyComponent() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
<Button onClick={() => setIsOpen(true)}>Open Dialog</Button>
<Dialog isOpen={isOpen} onClose={() => setIsOpen(false)} title="Example Dialog">
<p>This is a sample dialog with some content.</p>
</Dialog>
</>
);
}
Dropdown
import { Dropdown } from "@ezyren/oppr_ui";
function MyComponent() {
const [selectedOption, setSelectedOption] = useState<string | null>(null);
const options = [
{ label: "Option 1", value: "option1" },
{ label: "Option 2", value: "option2" },
{ label: "Option 3", value: "option3" },
];
return (
<>
<Dropdown
label="Select Option"
options={options}
onSelect={(value) => setSelectedOption(value)}
/>
{selectedOption && (
<p className="mt-4 text-gray-700">
Selected Option: <span className="font-semibold">{selectedOption}</span>
</p>
)}
</>
);
}Header
import { Header } from "@ezyren/oppr_ui";
<Header
logoSrc="/images/opprlogo.svg"
links={[
{ href: "/button", label: "Button" },
{ href: "/card", label: "Card" },
{ href: "/tooltip", label: "Tooltip" },
]}
/>