| Vue reusable components are there where you can import the component and pass the props for customization..
$ git clone https://github.com/linkon63/vue-reusable-components/tree/main
$ npm install
$ npm run dev
📑 note : there is reusable-component-playground file, where you can check the components and test and also explore every components 🌀.
Pre-requisites
Install Tailwind for use this library
Link : https://tailwindcss.com/docs/installation
## OR Include CDN in index.html file in your projects<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.css" rel="stylesheet" /><script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.js"></script><script src="https://cdn.tailwindcss.com"></script>## then install vue-reusable-components
$ npm i vue-reusable-components
1 BaseInput
it is for all the "text" | "number" | "phone" | "email" | "tel" | "search"
// component import<BaseInput/>/* props you can pass in <BaseInput /> type, placeholder, labelClass, disable, required, size, maxLength, maxLength, regExpForInput, validationMessage, validationMessageStyle, validationMessage, validationStatus, autoFocus, title */<BaseInput><template #suffix><button>
X
</button></template></BaseInput>
📑 note : You can pass slots #prefix and #suffix
demo
2️ BaseCheckbox
// component import<BaseCheckbox/>/* props you can pass in <BaseInput /> label?: string; labelClass?: string; class?: string; checked?: boolean; name?: string; disabled?: boolean; readonly?: boolean; required?: boolean; */// Example :<BaseCheckbox
@on-change="(e:Event) => { let value : HTMLInputElement = e.target as HTMLInputElement if (value) { console.log(value.value) } }"/>
📑 note : You can pass slots #inside but When you pass #inside slot then in class props given hidden class="hidden"
// component import<BaseAccordion/>/* props you can pass in <BaseAccordion />interface Props { alwaysOpen?: boolean; accordionPanelClass?: string; accordionLabel?: string; accordionContentClass?: string; visiblePanelIcon?: boolean;}*/// example<BaseAccordionaccordion-panel-class="bg-red-500 text-white w-3/12"accordion-content-class="w-3/12 bg-green-600"
:always-open="true"><template #panelPrefix>❕</template><template #panelSuffix>🚭</template><template #accordion-content><pclass="mb-2">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex, soluta!
</p><pclass="">Loremipsumdolorsitamet.<ahref="/docs/getting-started/introduction/"class="text-blue-600 dark:text-blue-500 hover:underline">StartYourThings</a>Loremipsumdolorsit,ametconsecteturadipisicingelit.Magnam,laborumqui!Beataererumcumoptioasperiores,similiquenatussapienteodit!</p></template></BaseAccordion>
📑 note :You can pass slots #panelPrefix and #panelSuffix , #panelIcon ,#accordionContent
demo
11 Base Tab View
// component import<BaseTabView/>/* props you can pass in <BaseTabView />interface Props { tabItems: TabItemType[]; tabListClass?: string; tabContentClass?: string; tabHeaderClass?: string;}*//*export interface TabItemType { id: string | number; tabName?: string; tabContent?: string; tabClass?: string; tabSelectedClass?: string; prefixIcon?: string; suffixIcon?: string; prefixIconClass?: string; suffixIconClass?: string;}*/// example<templateclass="w-full"><divclass="p-12"><BaseTabView
:tab-items="tabItems"tab-list-class="bg-red-400 w-4/12"tab-content-class="bg-green-400 w-4/12"tab-header-class="border-t-2 border-teal-700"/></div></template><scriptsetuplang="ts">importBaseTabViewfrom"./components/reusable-components/BaseTabView/BaseTabView.vue";importtype{TabItemType}from"./components/reusable-components/BaseTabView/types";consttabItems: TabItemType[]=[{id: 1,tabName: "Home",tabContent: "lorem ipsum dolor sit Home",tabClass: "bg-red-400 text-white",tabSelectedClass: "bg-blue-400 text-white",prefixIcon: "fab fa-js",},{id: 2,tabName: "About",tabContent: "lorem ipsum dolor sit About",tabSelectedClass: "bg-green-400 text-white",prefixIcon: "fab fa-vuejs",},{id: 3,tabName: "Profile",tabContent: "lorem ipsum dolor sit Profile"},{id: 4,tabName: "Dashboard",tabContent: "lorem ipsum dolor sit Dashboard",},];</script>
📑 note : index.html file import the cdn of front awesome
Example Below :
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8" />
<linkrel="icon" type="image/svg+xml" href="/vite.svg" />
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title><!-- This line you have to add Start --><linkrel="stylesheet"
href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
crossorigin="anonymous"
/>
<!-- This line you have to add End --></head><body><divid="app"></div><scripttype="module" src="/src/main.js"></script></body><scriptsrc="./node_modules/flowbite/dist/flowbite.min.js"></script></html>