docs: show HTML attribute name in API prop details (#817)

This commit is contained in:
rahim
2026-03-10 02:32:12 -07:00
committed by GitHub
parent 9598ee2848
commit 7463d20cd1
4 changed files with 23 additions and 4 deletions
@@ -1,4 +1,5 @@
---
import { kebabCase } from 'es-toolkit/string';
import MarkdownCode from '@/components/typography/MarkdownCode.astro';
import Td from '@/components/typography/Td.astro';
import DetailRow from './DetailRow.astro';
@@ -10,18 +11,21 @@ interface Props {
description?: string;
defaultValue?: string;
required?: boolean;
showAttributeName?: boolean;
componentName: string;
}
const { name, type, detailedType, description, defaultValue, required, componentName } = Astro.props;
const { name, type, detailedType, description, defaultValue, required, showAttributeName, componentName } = Astro.props;
const id = `${componentName}-${name}`;
const attributeName = showAttributeName ? kebabCase(name) : undefined;
---
<DetailRow
id={id}
name={name}
type={type}
attributeName={attributeName}
detailedType={detailedType}
description={description}
colspan={4}