First Commit
This commit is contained in:
27
src/List.tsx
Normal file
27
src/List.tsx
Normal file
@ -0,0 +1,27 @@
|
||||
import { h, JSX } from "preact";
|
||||
|
||||
export interface IListProps {
|
||||
clickable?: boolean;
|
||||
divider?: boolean;
|
||||
}
|
||||
|
||||
export default function List({
|
||||
clickable,
|
||||
divider,
|
||||
className,
|
||||
children,
|
||||
...props
|
||||
}: JSX.HTMLAttributes<HTMLUListElement> & IListProps) {
|
||||
let cl = "ht-list ";
|
||||
if (clickable) cl += "ht-list-clickable ";
|
||||
|
||||
if (divider) cl += "ht-list-divider ";
|
||||
|
||||
cl += className;
|
||||
|
||||
return (
|
||||
<ul className={className} {...props}>
|
||||
{children}
|
||||
</ul>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user