Self-hosted house planner: true-scale 2D floor plan, 3D, satellite map overlay, sewer, electrical, water and underfloor heating with calculations, priced bill of materials. React + PHP, no database. By the team behind homedesignsai.pro
TypeScript 3darchitecturebill-of-materialscadconstructionelectrical-designfloor-planfloorplan-editorhome-designhouse-plannerkonvamaplibrephpplumbingreactreact-three-fiberself-hostedthreejstypescriptunderfloor-heating
import type { ButtonHTMLAttributes, ReactNode } from 'react'
import { cx } from './cx'
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
variant?: 'default' | 'primary' | 'ghost' | 'danger'
size?: 'sm' | 'md'
pressed?: boolean
icon?: ReactNode
}
export function Button({ variant = 'default', size = 'md', pressed, icon, className, children, type = 'button', ...rest }: ButtonProps) {
return (
<button
type={type}
className={cx('btn', `btn--${variant}`, size === 'sm' && 'btn--sm', pressed && 'btn--pressed', className)}
aria-pressed={pressed}
{...rest}
>
{icon && <span className="btn__icon">{icon}</span>}
{children}
</button>
)
}