General Tab
General Tab – Company Information
The General.jsx component is responsible for collecting all the core details about a company. It is organized into
three main sections:
- General Info
- Address
- Contact Information
This tab uses components from the so-kit-ui library to structure and render a form in a clean, responsive layout.
Code Example
Create or open the file: src/pages/company/components/tabs/General.jsx
General.jsx
import {
DatePicker,
Input,
Section,
SectionContainer,
SectionTitle,
Select,
} from 'so-kit-ui';
const legalForms = [
{
code: 'LLC',
description: 'Limited Liability Company',
},
{
code: 'CORP',
description: 'Corporation',
},
{
code: 'SOLO',
description: 'Sole Proprietorship',
},
{
code: 'PART',
description: 'Partnership',
},
{
code: 'LLP',
description: 'Limited Liability Partnership',
},
{
code: 'OT',
description: 'Other',
},
];
export const companyTypes = [
{
code: 'IT',
description: 'Information Technology',
},
{
code: 'ED',
description: 'Education',
},
{
code: 'RE',
description: 'Research',
},
{
code: 'FI',
description: 'Financial',
},
{
code: 'TR',
description: 'Trade',
},
{
code: 'OT',
description: 'Other',
},
];
const General = () => {
return (
<SectionContainer
padded
page
>
<Section columns={2}>
<SectionTitle>title.general.info</SectionTitle>
<Section.Elements>
<Input id='companyName' />
<Select
id='legalForm'
options={legalForms}
vlCodeDescription
valueOnly
/>
<DatePicker id='establishedDate' />
<Input
id='capital'
type='decimal'
minValue={0}
formatOptions={{
maximumFractionDigits: 2,
}}
/>
<Input
id='employees'
type='number'
/>
<Select
id='type'
options={companyTypes}
vlCodeDescription
/>
</Section.Elements>
</Section>
<Section>
<SectionTitle>title.general.address</SectionTitle>
<Section.Elements>
<Input id='address.street' />
<Input id='address.city' />
<Input id='address.state' />
<Input id='address.zip' />
</Section.Elements>
</Section>
<Section>
<SectionTitle>title.general.contact</SectionTitle>
<Section.Elements>
<Input id='website' />
<Input id='phone' />
<Input id='email' />
</Section.Elements>
</Section>
</SectionContainer>
);
};
export default General;
🧠 How It Works
- The form is divided using the
SectionContainerandSectioncomponents fromso-kit-ui, which help structure the content using a Tailwind CSS-based grid system. - Each
Sectionhas a title (SectionTitle) and a group of input elements (Section.Elements). - Standard form controls are used:
Input,DatePicker, andSelect.- Basic components like Input are used for both
textandnumericfields. You can customize the behavior using thetypeattribute.- For more complex fields—like capital—set the type to "decimal" to allow decimal values. You can also define
formatOptions, such asmaximumFractionDigits: 2, to limit the input to two decimal places and ensure consistent formatting.
- For more complex fields—like capital—set the type to "decimal" to allow decimal values. You can also define
- The
Selectother than the id of the key in the data response uses theoptionsprop to populate its options. ThevlCodeDescriptionprop is used to map thecodeanddescriptionfields from thelegalFormsorcompanyTypesarrays. This because for default the select uses value-label as identifier for the options.
- Basic components like Input are used for both
🔄 Customization Example
- The
capitalfield includestype="decimal"andformatOptionsto format currency inputs with 2 decimal places. - The
Selectcomponent fortypeuses thecompanyTypesarray to populate its options, mappingcodeas the value anddescriptionas the label.
This component is fully extensible—just add new fields or sections as needed!