@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
85 lines (80 loc) • 2.69 kB
TypeScript
import { SCCategoryType } from '@selfcommunity/types';
import { CategoriesSkeletonProps } from './Skeleton';
import { CategoryProps } from '../Category';
export interface CategoriesProps {
/**
* Overrides or extends the styles applied to the component.
* @default null
*/
className?: string;
/**
* CategoryComponent component
* Usefully to override the single Category render component
* @default Category
*/
CategoryComponent?: (inProps: CategoryProps) => JSX.Element;
/**
* Props to spread to single category object
* @default {variant: 'outlined', ButtonBaseProps: {disableRipple: 'true'}}
*/
CategoryComponentProps?: CategoryProps;
/**
* CategorySkeletonComponent component
* Usefully to override the single Category skeleton render component
* @default Skeleton
*/
CategoriesSkeletonComponent?: (inProps: any) => JSX.Element;
/**
* Props to spread to single category skeleton object
* @default {variant: 'outlined'}
*/
CategoriesSkeletonProps?: CategoriesSkeletonProps;
/**
* Show/Hide filters
* @default true
*/
showFilters?: boolean;
/**
* Filters component
* @param props
*/
filters?: JSX.Element;
/**
* Override filter func
* @default null
*/
handleFilterCategories?: (categories: SCCategoryType[]) => SCCategoryType[];
/**
* Prefetch categories. Useful for SSR.
* Use this to init the component with categories
* @default null
*/
prefetchedCategories?: SCCategoryType[];
/**
* Other props
*/
[p: string]: any;
}
/**
* > API documentation for the Community-JS Categories component. Learn about the available props and the CSS API.
*
*
* The Categories component renders the list of all available categories.
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/AccountRecover)
#### Import
```jsx
import {Categories} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCCategories` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCCategories-root|Styles applied to the root element.|
|filters|.SCCategories-filter|Styles applied to the filter.|
|categories|.SCCategories-categories|Styles applied to the list of categories.|
|category|.SCCategories-category|Styles applied to the of category element.|
|noResults|.SCCategories-no-results|Styles applied to no results section.|
* @param inProps
*/
export default function Categories(inProps: CategoriesProps): JSX.Element;