### Basic MpTooltip Playground Example (Vue 3) Source: https://docs.mekari.design/components/tooltip A basic example showcasing the MpTooltip component in a Vue 3 setup. It includes importing necessary components and a template demonstrating a tooltip with a hoverable text element. This serves as a starting point for integrating tooltips. ```vue ``` -------------------------------- ### MpText Component Usage Examples Source: https://docs.mekari.design/components/text Examples demonstrating how to use the MpText component with different props. ```APIDOC ## MpText Component Usage Examples ### Description This section provides practical examples of using the `MpText` component for various styling needs. ### Size Variations #### Example 1: H1 Title ```html ``` #### Example 2: H2 Title ```html ``` ### General Text Display #### Example 3: Basic Paragraph ```html ``` ``` -------------------------------- ### Badge Usage Examples Source: https://docs.mekari.design/components/badge Provides examples of how to use the MpBadge component with different variants, colors, and sizes. ```APIDOC ## Badge Usage Examples ### Variant This example demonstrates the usage of the `MpBadge` component with different `for` prop values. ```html ``` ### Variant Color This example showcases the `MpBadge` component with various `type` prop values to represent different status colors. ```html ``` ### Size This example demonstrates how to adjust the size of the `MpBadge` component using the `size` prop. ```html ``` ``` -------------------------------- ### Modal Playground Example (Vue 3) Source: https://docs.mekari.design/components/modal A Vue 3 playground example showcasing the implementation of the Modal component. It includes basic setup with refs for controlling modal visibility and event handlers for open and close actions. ```vue ``` -------------------------------- ### MpFlex Component Usage Example (Vue.js) Source: https://docs.mekari.design/components/flex An example demonstrating the usage of the MpFlex component within a Vue.js template. It showcases how to apply various props like direction, alignment, and spacing to structure content. The example includes nested MpFlex components and MpText for content display. ```html ``` -------------------------------- ### Autocomplete Playground Example (Vue) Source: https://docs.mekari.design/components/autocomplete A Vue.js playground example demonstrating the MpAutocomplete component. It shows how to set up options, bind the selected value, and configure various props like searchability, keep-alive, and clearability. ```vue ``` -------------------------------- ### MpImage Usage Examples Source: https://docs.mekari.design/components/image Examples demonstrating different layout options for the MpImage component. ```APIDOC ## MpImage Usage Examples ### Description Demonstrates various layout configurations for the MpImage component. ### Method N/A (Component Usage) ### Endpoint N/A ### Parameters N/A ### Request Example ```html ``` ### Response #### Success Response (200) N/A (Component renders UI elements) #### Response Example N/A ``` -------------------------------- ### Basic MpTextarea Playground Setup (Vue) Source: https://docs.mekari.design/components/textarea A basic setup for the MpTextarea component using Vue.js and the Composition API. It shows how to import and render the component within a template. ```html ``` -------------------------------- ### Basic MpSelect Usage Example (Vue 3) Source: https://docs.mekari.design/components/select A basic example of how to use the MpSelect component in Vue 3. It shows how to bind a value using v-model and includes options for the select input. The `is-clearable` prop is also demonstrated. ```vue ``` -------------------------------- ### Basic MpText Usage with Template (Vue.js) Source: https://docs.mekari.design/components/text This example demonstrates the basic usage of the MpText component within a Vue.js template. It includes the necessary script setup for importing the component and displays placeholder text. ```html ``` -------------------------------- ### MpTextlink Usage Examples Source: https://docs.mekari.design/components/textlink Examples demonstrating different ways to use the MpTextlink component, including variants, icons, and states. ```APIDOC ## MpTextlink Usage Examples ### Variant Demonstrates the different visual variants available for the text link. ```html ``` ### With Icon Shows how to add icons to the left or right of the text link. ```html ``` ### Other States (Loading and Disabled) Illustrates the loading and disabled states of the text link. ```html ``` ``` -------------------------------- ### Tabs Playground Example with Vue.js and TypeScript Source: https://docs.mekari.design/components/tabs A Vue.js playground example demonstrating the default usage of the Tabs component. It includes importing necessary components and setting up a basic tab structure with content for each tab. This example utilizes TypeScript for type safety. ```html ``` -------------------------------- ### Drawer Playground Example (Vue.js) Source: https://docs.mekari.design/components/drawer A Vue.js example demonstrating the usage of the MpDrawer component. It includes a button to open the drawer, controls for its visibility, and event handlers for opening and closing. The example utilizes other Mekari Pixel components like MpButton and MpButtonGroup. ```vue ``` -------------------------------- ### Basic MpCheckbox Usage Example (Vue 3) Source: https://docs.mekari.design/components/checkbox A simple Vue 3 template and script setup demonstrating the basic usage of the MpCheckbox component. It shows how to bind the checked state using `v-model` and display the current state. ```vue ``` -------------------------------- ### Basic Chart Playground Example (Vue.js) Source: https://docs.mekari.design/components/chart A Vue.js template demonstrating the basic usage of the MpChart component. It includes sample data and options for configuring the chart, such as title and data points. This example is useful for quickly testing and visualizing chart functionalities. ```html ``` ```javascript ``` -------------------------------- ### MpTooltip with Icons Usage Example (Vue 3) Source: https://docs.mekari.design/components/tooltip Illustrates how to use the MpTooltip component with MpIcon components in Vue 3. This example shows different placements of tooltips relative to icons, providing contextual information for each icon. ```vue ``` -------------------------------- ### MpIcon Component: Size Examples (Vue.js) Source: https://docs.mekari.design/components/icon Illustrates how to control the size of the MpIcon component. This example requires importing MpIcon and MpFlex from '@mekari/pixel3'. It shows the 'md' and 'sm' size variants of the 'profile' icon. ```html ``` -------------------------------- ### Basic MpInputTag Usage Example Source: https://docs.mekari.design/components/input-tag A basic example demonstrating how to use the MpInputTag component within a Vue template. It includes importing the component and setting up a script for its usage. ```html ``` -------------------------------- ### Vue.js Date Picker Playground Example Source: https://docs.mekari.design/components/date-picker A Vue.js example demonstrating the usage of the MpDatePicker component. It shows how to bind a date value using v-model and display the selected date. This example utilizes MpFlex and MpText components for layout and text display. ```vue ``` -------------------------------- ### Free Tag Usage Example Source: https://docs.mekari.design/components/input-tag Example of how to use the MpInputTag component to create free tags with suggestions. ```APIDOC ## Usage: Free Tag ### Description This example demonstrates how to use the `MpInputTag` component to allow users to create free tags, with a predefined list of suggestions. ### Code Example ```html ``` ### Parameters - **`id`**: `"input-tag-with-free-tag"` (string) - Unique identifier for the input tag. - **`placeholder`**: `"Create new tag"` (string) - Placeholder text displayed when the input is empty. - **`max-tags`**: `3` (number) - Maximum number of tags allowed. - **`suggestions`**: `['Jakarta', 'Medan', 'Bandung', 'Surabaya']` (Array) - List of available suggestions. - **`key-code`**: `['Enter', ';', ',']` (Array) - Key codes that trigger tag creation. - **`is-show-suggestions`**: `true` (boolean) - Makes the suggestions list visible. - **`is-show-input`**: `isShowInput` (ref) - Controls the visibility of the input field, dynamically updated based on the number of tags. ### Events - **`@change`**: `handleChange` - Callback function triggered when the tags change. It receives the updated data array. - **`@input`**: `handleInput` - Callback function triggered when the input value changes. It receives the current input string. - **`@select`**: `handleSelect` - Callback function triggered when a suggestion is selected. It receives the selected suggestion string. ``` -------------------------------- ### MpLoader Component Playground Example Source: https://docs.mekari.design/components/loader A Vue.js playground example demonstrating the MpLoader component. It shows how to import and use MpLoader with custom size and spacing props within a Vue template. ```html ``` -------------------------------- ### MpIcon Component: Variant Examples (Vue.js) Source: https://docs.mekari.design/components/icon Demonstrates how to use the MpIcon component with different visual variants. It requires importing MpIcon and MpFlex from '@mekari/pixel3'. The example shows an 'outline' and a 'fill' variant of the 'profile' icon. ```html ``` -------------------------------- ### Basic Popover Example (Vue 3) Source: https://docs.mekari.design/components/popover A basic implementation of the Popover component in Vue 3. This example demonstrates how to set up a trigger button and content for the popover, utilizing the MpPopover, MpPopoverTrigger, and MpPopoverContent components. It also shows the use of the `css` utility for styling. ```html ``` -------------------------------- ### Timeline Component Usage Example (Vue.js) Source: https://docs.mekari.design/components/timeline A Vue.js example demonstrating how to use the MpTimeline component. It includes importing necessary components and utilities, setting up the component's script, and rendering a timeline item with approval status, date, and content. ```html ``` -------------------------------- ### Import Tour Component from Pixel3 Source: https://docs.mekari.design/components/tour Demonstrates how to import the 'tour' object from the '@mekari/pixel3' package. This is the primary step to utilize the Tour component in your project. Ensure the package is installed. ```javascript import { tour } from '@mekari/pixel3' ``` -------------------------------- ### Basic Toast Notification Example (Vue 3) Source: https://docs.mekari.design/components/toast A simple example demonstrating how to trigger a success toast notification with a title and position using the `toast.notify` function within a Vue 3 setup. It also includes a button to clear all active toasts. ```vue ``` -------------------------------- ### Render Icon with MpIcon Component Source: https://docs.mekari.design/components/icon A Vue.js playground example showcasing how to use the MpIcon component to render an icon with the name 'profile'. It includes the necessary template and script setup. ```html ``` -------------------------------- ### Basic MpSlider Usage (Vue Template) Source: https://docs.mekari.design/components/slider A basic example of using the MpSlider component within a Vue.js template. It shows the component's tag and the necessary script setup for importing it. ```html ``` -------------------------------- ### Input Usage: Size Source: https://docs.mekari.design/components/input Example demonstrating different sizes of the MpInput component. ```APIDOC ## Usage: Size ### Description Demonstrates the different sizes available for the Input component. ### Request Example ```html ``` ``` -------------------------------- ### Mekari Table Example with Data (Vue.js) Source: https://docs.mekari.design/components/table Demonstrates how to implement a table using Mekari Design Components in a Vue.js application. It includes a template for the table structure and a script setup section to define and populate the employee data. ```html ``` -------------------------------- ### MpTooltip with Portal Usage Example (Vue 3) Source: https://docs.mekari.design/components/tooltip Shows how to enable portal rendering for the MpTooltip component in Vue 3 using the `use-portal` prop. This is useful for ensuring tooltips are rendered outside their parent DOM hierarchy, preventing overflow issues and improving stacking context. ```vue ``` -------------------------------- ### Mekari Tour API Reference Source: https://docs.mekari.design/components/tour This section outlines the API for the Mekari tour functionality. It details the parameters for the `tour` function, including `isStartTour`, `steps`, and `options`. The `steps` array allows configuration of individual tour elements, while the `options` object provides global tour settings. ```javascript // Use tour function with steps and options parameter to show tour on your applications tour(isStartTour, steps, options) steps: [ { target: '#tour-dashboard-1', // define target element, using web API document.querySelector() under the hood, if not defined Tour will render as intro. options: { // option object receive any valid Popper.js configuration placement: 'bottom' // placement of content, default to bottom }, isHighlighted: true, // show highlighted target element highlightColor: 'pink', // variant of highlight color, available pink, blue and black isScrollIntoElement: true, // scrolling into target element, using web API scrollTo() under the hood offset: 0 // set top offset when scrolling into target element, default to 16 render: (next, prev, close) => void // render of tour, return next, prev and close functions }, ] options: { id: 'tour', // id for MpTour stepIndex: 0, // represent index for first tour, default to 0 isDisableScroll: false, // if true, disabled scrolling event in body isManual: true, // if true, handle MpTour event manually isDebug: true, // if true, show debug info in console next: nextFunction, // function for handle next action, return step index prev: prevFunction, // function for handle back action, return step index close: closeFunction, // function for handle back action, return step index } ``` -------------------------------- ### Configure Accordion Icon Position (Vue.js) Source: https://docs.mekari.design/components/accordion This snippet demonstrates how to control the position of the accordion icon using the 'icon-position' attribute on the MpAccordionItem component. It utilizes Vue.js and the '@mekari/pixel3' library. The example shows default icon placement and explicitly setting it to 'start'. ```vue ``` -------------------------------- ### Display and Clear Toasts with Variants (Vue 3) Source: https://docs.mekari.design/components/toast Demonstrates how to use the `toast.notify` function to display different types of toasts (success, error, greeting) and `toast.closeAll` to dismiss them. This example utilizes Vue 3's ` ```