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 IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
label: string
children: ReactNode
active?: boolean
size?: 'sm' | 'md'
}
export function IconButton({ label, children, active, size = 'md', className, type = 'button', ...rest }: IconButtonProps) {
return (
<button
type={type}
aria-label={label}
title={label}
className={cx('icon-btn', size === 'sm' && 'icon-btn--sm', active && 'icon-btn--active', className)}
{...rest}
>
{children}
</button>
)
}