Skip to content

Commit d7177ce

Browse files
committed
docs(sistent): condense IconButton component and move Props and Bestpractices to Guidance page
Signed-off-by: Naik Mubashir <naikmubashir095@gmail.com>
1 parent a30bec0 commit d7177ce

3 files changed

Lines changed: 113 additions & 295 deletions

File tree

src/sections/Projects/Sistent/components/iconbutton/code.js

Lines changed: 4 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ const IconButtonCode = () => {
118118
</div>
119119
<div className="main-content">
120120
<p>
121-
IconButtons provide a compact way to trigger actions using only
122-
iconography. They're essential for creating clean, space-efficient
123-
interfaces.
121+
IconButtons provide compact action triggers using iconography,
122+
essential for clean, space-efficient interfaces.
124123
</p>
125124
<a id="Basic IconButton">
126125
<h2>Basic IconButton</h2>
@@ -145,8 +144,8 @@ const IconButtonCode = () => {
145144
</a>
146145
<p>
147146
IconButtons come in three sizes: small (32px), medium (40px), and
148-
large (48px). Choose the appropriate size based on your interface
149-
requirements and accessibility needs.
147+
large (48px). Choose based on interface requirements and
148+
accessibility needs.
150149
</p>
151150
<div className="showcase">
152151
<div className="items">
@@ -233,130 +232,6 @@ const IconButtonCode = () => {
233232
</div>
234233
<CodeBlock name="disabled-iconbutton" code={codes[4]} />
235234
</div>
236-
237-
<a id="Props">
238-
<h2>Props</h2>
239-
</a>
240-
<p>
241-
The IconButton component accepts all standard button props plus
242-
additional customization options:
243-
</p>
244-
245-
<div className="table-container">
246-
<table className="props-table">
247-
<thead>
248-
<tr>
249-
<th>Prop</th>
250-
<th>Type</th>
251-
<th>Default</th>
252-
<th>Description</th>
253-
</tr>
254-
</thead>
255-
<tbody>
256-
<tr>
257-
<td>children</td>
258-
<td>node</td>
259-
<td>-</td>
260-
<td>The icon element to display inside the button</td>
261-
</tr>
262-
<tr>
263-
<td>size</td>
264-
<td>'small' | 'medium' | 'large'</td>
265-
<td>'medium'</td>
266-
<td>The size of the IconButton</td>
267-
</tr>
268-
<tr>
269-
<td>color</td>
270-
<td>
271-
'inherit' | 'primary' | 'secondary' | 'error' | 'info' |
272-
'success' | 'warning'
273-
</td>
274-
<td>'inherit'</td>
275-
<td>The color of the IconButton</td>
276-
</tr>
277-
<tr>
278-
<td>disabled</td>
279-
<td>bool</td>
280-
<td>false</td>
281-
<td>If true, the IconButton is disabled</td>
282-
</tr>
283-
<tr>
284-
<td>onClick</td>
285-
<td>func</td>
286-
<td>-</td>
287-
<td>Callback fired when the IconButton is clicked</td>
288-
</tr>
289-
<tr>
290-
<td>aria-label</td>
291-
<td>string</td>
292-
<td>-</td>
293-
<td>Accessibility label for screen readers (required)</td>
294-
</tr>
295-
<tr>
296-
<td>sx</td>
297-
<td>object</td>
298-
<td>-</td>
299-
<td>System prop for custom styling</td>
300-
</tr>
301-
</tbody>
302-
</table>
303-
</div>
304-
305-
<a id="Best Practices">
306-
<h2>Best Practices</h2>
307-
</a>
308-
<ul>
309-
<li>
310-
<strong>Always include aria-label:</strong> Essential for
311-
accessibility and screen readers
312-
</li>
313-
<li>
314-
<strong>Use recognizable icons:</strong> Choose icons that clearly
315-
represent the action
316-
</li>
317-
<li>
318-
<strong>Maintain adequate spacing:</strong> Ensure sufficient
319-
space between IconButtons
320-
</li>
321-
<li>
322-
<strong>Provide hover feedback:</strong> Clear visual feedback for
323-
interactive states
324-
</li>
325-
<li>
326-
<strong>Consider touch targets:</strong> Use appropriate sizes for
327-
mobile interfaces
328-
</li>
329-
<li>
330-
<strong>Test with users:</strong> Verify that icon meanings are
331-
clear to your target audience
332-
</li>
333-
</ul>
334-
335-
<a id="Common Use Cases">
336-
<h2>Common Use Cases</h2>
337-
</a>
338-
<ul>
339-
<li>
340-
<strong>Toolbar actions:</strong> Edit, delete, share, and other
341-
quick actions
342-
</li>
343-
<li>
344-
<strong>Navigation:</strong> Back, forward, close, and menu
345-
toggles
346-
</li>
347-
<li>
348-
<strong>Media controls:</strong> Play, pause, skip, and volume
349-
controls
350-
</li>
351-
<li>
352-
<strong>List item actions:</strong> Quick actions for items in
353-
lists or tables
354-
</li>
355-
<li>
356-
<strong>Toggle states:</strong> Favorite, bookmark, or
357-
follow/unfollow actions
358-
</li>
359-
</ul>
360235
</div>
361236
</div>
362237
</SistentLayout>

0 commit comments

Comments
 (0)