Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CspmIT/centinela-front/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheButtonCustom component is a flexible button wrapper that extends standard HTML button functionality with custom styling and consistent design across the Centinela application. It supports multiple button types, custom classes, and disabled states.
Import
Props
The HTML button type attribute. Common values include:
button- Standard buttonsubmit- Form submission buttonreset- Form reset button
The content to display inside the button. Can include text, icons, or other React components.
Event handler function called when the button is clicked.
Additional configuration object with the following properties:
Alternative way to provide button text. Takes priority over
children if both are provided.Custom CSS classes to apply to the button for additional styling.
Whether the button should be disabled (non-interactive).
Default Styling
The component applies the following default classes:py-2.5- Vertical paddingpx-4- Horizontal paddingfont-semibold- Bold font weightAeromaticsRegular- Custom font familyrounded-xl- Extra large border radiusshadow-md- Medium shadow effect
Usage Examples
Basic Button
Submit Button with Custom Styling
Disabled Button
Button with Icon Children
Primary Action Button
Danger Button
Common Use Cases
- Form Submission
- Conditional State
Component Source
Location:~/workspace/source/src/components/ButtonCustom/index.jsx
The ButtonCustom component provides a consistent button interface across the Centinela application. For more complex button states or variants, consider wrapping this component or extending its props object with additional styling options.
Accessibility
- Always provide meaningful text through either
childrenorprops.text - Use appropriate
typeattribute for form contexts - Ensure disabled states are visually distinct
- Consider adding ARIA labels for icon-only buttons
Best Practices
- Consistent Styling: Define reusable button style classes for common actions (primary, secondary, danger)
- Loading States: Disable buttons during async operations and update text to reflect state
- Type Specification: Always specify the button type to prevent unintended form submissions
- Click Handlers: Use the
onclickprop instead of wrapping in additional elements
