You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<svgwidth="150"height="50"xmlns="http://www.w3.org/2000/svg">
<!-- Fondo del chip/badge -->
<rectx="10"y="10"width="130"height="30"rx="15"ry="15"style="fill:lightgray;stroke:gray;stroke-width:2"/>
<!-- Texto del chip/badge -->
<textx="30"y="30"font-family="Arial"font-size="16"fill="black">Badge Label</text>
</svg>
React Konva (just take this as a starting point):
importReact,{forwardRef}from'react';import{Group,Rect,Text}from'react-konva';import{ShapeConfig}from'konva/lib/Shape';interfaceChipPropsextendsShapeConfig{id: string;x: number;y: number;width: number;height: number;label: string;fillColor?: string;textColor?: string;}exportconstChip=forwardRef<any,ChipProps>(({ x, y, width, height, label, fillColor ='lightgray', textColor ='black', id, ...shapeProps},ref)=>{constpadding=10;return(<Groupx={x}y={y}ref={ref}{...shapeProps}>{/* Fondo del chip/badge */}<Rectx={0}y={0}width={width}height={height}fill={fillColor}stroke="gray"strokeWidth={2}cornerRadius={height/2}// Para hacer las esquinas redondeadas/>{/* Texto del chip/badge */}<Textx={padding}y={height/2-8}// Centrar verticalmentetext={label}fontFamily="Arial"fontSize={16}fill={textColor}/></Group>);});exportdefaultChip;
The text was updated successfully, but these errors were encountered:
Svg example
React Konva (just take this as a starting point):
The text was updated successfully, but these errors were encountered: