Skip to content

Utilities and Components to extend the Raycast Extensions API functionalities

Notifications You must be signed in to change notification settings

isabella232/raycast-toolkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raycast Toolkit

This is an unofficial package to develop Raycast Extensions that provides additional hooks and components useful to perform more advanced operations.

Documentation

Note: the exported namespaces are suffixed with a dollar sign ($) to avoid to conflict with the @raycast/api ones.

Components

Action$.SelectFile

When this action is called, a Finder file prompt window will be displayed, the user can select the file they prefer and the onSelect callback will be called with the POSIX path of the chosen file.

import { ActionPanel } from '@raycast/api';
import { Action$ } from 'raycast-toolkit';

const Example = () => (
  <ActionPanel>
    <Action$.SelectFile
      prompt="Select a .csv file"
      type="csv"
      onSelect={(path) => console.log('Selected file at path:', path)}
    />
  </ActionPanel>
);

Hooks

usePersistentState

Provides an interface compatible with useState but that persists its value on the Raycast LocalStorage.

import { usePersistentState } from 'raycast-toolkit';

const [persistentCounter, setPersistentCounter] = usePersistentState(
  'my-state-key', // LocalStorage key
  0 // initial value
);

About

Utilities and Components to extend the Raycast Extensions API functionalities

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%