Get help from the marimo community

Updated 2 weeks ago

custom snippets

At a glance

The community members discuss the ability to add custom snippets instead of the default snippets. One community member notes that there is currently no option to do this, but suggests submitting a request or a pull request. Another community member asks about specific use cases for custom snippets, such as for interactive libraries like Altair and Plotly.

The answer provided by a community member indicates that the ability to add custom snippets has been added, and that users can do so by adding a .marimo.toml file in the root of their project with the following configuration:

[snippets] custom_paths = ['path/to/snippets_folder'] include_default_snippets = true

The community members also suggest that the documentation should be updated to reflect this new feature.

Is there a way to add custom snippets instead of the default snippets?
Marked as solution
Believe this was added here PR
You need to add this in your .marimo.toml file at the root of your project
Plain Text
[snippets]
custom_paths = ['path/to/snippets_folder']
include_default_snippets = true

The snippets are just python files. example

We should add something in the docs to show this is possible now πŸ˜…
View full solution
H
S
4 comments
Don't think there exists an option do that at the moment. In the current snippets panel, you'll notice a '+' sign where you can request one through the UI or submit a PR.
You have any specific use-case/frequent snippet for which you'd like to just insert easily? I was thinking of adding a couple of snippets with regards to interactive libraries we support for ease of usage, i.e., altair, plotly,
Believe this was added here PR
You need to add this in your .marimo.toml file at the root of your project
Plain Text
[snippets]
custom_paths = ['path/to/snippets_folder']
include_default_snippets = true

The snippets are just python files. example

We should add something in the docs to show this is possible now πŸ˜…
Ah, can't believe I missed this. Thanks for pointing it out! Can get a PR running for updating docs about this soon.
Add a reply
Sign up and join the conversation on Discord