Frappe UI

repository·main·Indexed 21 days ago

https://github.com/frappe/frappe-ui

A library of Vue 3 components and utilities for rapid frontend development of Frappe applications. Built with Tailwind CSS, Headless UI, and TipTap, it provides a modern design system featuring a composition model for editors, a unified Dialog component, and a set of Vite plugins for proxying backend requests, auto-generating TypeScript types from DocTypes, and integrating Lucide icons.

Tokens
160.6K
Snippets
505
Records
819
Agent score
64%

What's inside frappe-ui

  1. What is Frappe UI?

    main

    Frappe UI is a library of Vue 3 components and utilities designed for building frontend applications that integrate with the Frappe Framework. It provides generic UI components (e.g., Button, Link, Dialog) and specialized utilities for server-side data fetching, directives, and other frontend tasks.

    Key dependencies include:

    • Vue 3
    • TailwindCSS
    • Headless UI
    • PopperJS
    • TipTap
    • Feather Icons
  2. Overview of the DatePicker & TimePicker family

    main

    The frappe-ui picker family consists of four main components used for date and time selection:

    • DatePicker: For selecting a single date.
    • DateRangePicker: For selecting a start and end date range.
    • DateTimePicker: A combined component for selecting both date and time.
    • TimePicker: A standalone component for time selection (also used internally by DateTimePicker).

    Note: The DateRangePicker emits values as an array of strings [fromDate, toDate] in YYYY-MM-DD format, or an empty array [] when cleared.

  3. Use the Tabs component to organize content

    main
    The Tabs component is used to organize content into separate panels that users can switch between. It is designed to make navigating related sections of an interface quick and intuitive. It supports different orientations and the use of icons within the tab headers.
  4. Use DatePicker components for date, datetime, and range selection

    main

    Frappe UI provides a suite of picker components designed for smooth and intuitive date selection. Depending on your requirements, you can use:

    • Date Picker: For selecting a single specific date.
    • DateTime Picker: For selecting both a date and a specific time.
    • Date Range Picker: For selecting a start and end date to define a period.

    These components are designed to make choosing and adjusting values quick and precise within your application interfaces.

  5. Understand the Frappe UI v1 Release Strategy

    main

    The frappe-ui v1 release focuses on API stability rather than feature completeness. The primary goal is to freeze the core component APIs and the recommended data API path to support a long-lived 1.x version line.

    Key v1 characteristics:

    • Stable Core APIs: Core component APIs are audited and stable.
    • Modernized Implementation: Core components use TypeScript and Vue <script setup>.
    • Data API Transition: v3 data APIs are the recommended path for new work (especially for Frappe v16+).
    • Deprecation Path: v1 resource APIs and v2 composables are deprecated but remain available for migration.
    • Documentation: The release includes refreshed docs, migration guides, and deprecation warnings.
  6. Use the Slider component

    main

    The Slider component is a slider input used to select a single value or a range of values within a specified min and max boundary. It supports different sizes, range selection (two thumbs), and bidirectional filling when handling negative values.

    <Slider v-model="value" :min="0" :max="100" />
  7. Use Frappe UI Chart components

    main
    Frappe UI provides a collection of flexible chart components designed for data visualization. These components include support for various chart types such as axis-based charts, donut charts, funnel charts, and numeric charts. Use these components to render visual representations of your data within your Vue applications.
  8. Use the TextInput component

    main
    The TextInput component is a flexible input field for text, numbers, and other string-based data. It supports various visual styles (variants), sizes, and input types. It also allows for custom content via prefix and suffix slots, and integrates with a labeling contract for error handling and descriptions.