govil-strip-content-base
v1.0.3
Published
A strip of single generic content. package name changed from 'govil-strip-g-content'
Downloads
1
Readme
govil-strip-content-base
generic content that get dynamic data
How to use
Clone this repo to your local computer, then run:
npm install && npm run build
You can now import govil-strip-content-base
as a normal package installed from npm like so:
import StripGContent from 'govil-strip-content-base
';
...
You can also import the type definitions if you're using TypeScript like so:
import StripGContent, { ComponentModel } from 'govil-strip-content-base
';
...
Available props/state Models
interface Model {
vm: ComponentModel;
}
export interface ComponentModel {
title: string
subTitle: string
description: string //html
links: Array<LinkableTitle>
contentId: string //for accessibility
role: string //for accessibility
labelledby: string //for accessibility
resources: {
collapseTitle: string,
expandTitle: string,
}
}
interface IStateModel {
isExpandedLinks: boolean
}
//imported from 'govil-links'
interface LinkableTitle {
title: string,
url: string,
isInternal: boolean
}
To customize this component, pass ComponentModel to the vm
prop.
// your-component.js
import StripGContent, { ComponentModel } from 'govil-strip-content-base
';
...
{ this.state.currentStepIndex === index &&
<div className={css.content_container}>
<StripGContent vm={this.state.currentStep} />
</div>
}
...
This component was built for the benefit of the citizens of Israel on behalf of the government, but of course also for the benefit of the OpenSource community and freely published in npm