Comments (7)
You should be able to apply widths to different elements, using the .style()
API. You can do this on ui elements (slider, text, etc), as well as layout elements (hstack
, vstack
)
import marimo as mo
mo.vstack([
mo.ui.text(full_width=True).style({"width": "500px"}),
mo.ui.text(full_width=True).style({"width": "300px"}),
mo.ui.text(full_width=True).style({"width": "100px"}),
])
![image](https://private-user-images.githubusercontent.com/2753772/343944455-3accb80d-6574-47a2-831e-01579f6a8570.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NTA1MjQsIm5iZiI6MTcyMTc1MDIyNCwicGF0aCI6Ii8yNzUzNzcyLzM0Mzk0NDQ1NS0zYWNjYjgwZC02NTc0LTQ3YTItODMxZS0wMTU3OWY2YTg1NzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTU1NzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzZkZWZmN2VkMjMwZjk0Mzc5OWJjNjMyMzUxMGMzOWIxZWVjNDY5NzdjMzQwZDk3YzRlYjMwZThkMWFlZDBhMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.w44JpefbuR5HtBYGF2n5s9xA1S-7tV0tKNxxuh7ggYI)
from marimo.
Thanks for your reply. If I understand correctly, this method applies only to individual elements (cells), not to the entire document. Regarding the whole document, we cannot go over the three default alternatives: compact, medium, and full. Wright?
from marimo.
That is correct - it's just for the elements. The only widths are compact, medium, and full
which we feel cover the use cases we found.
If this is for running marimo as an application with particular layouting - you may want to checkout the Grid Layout
https://docs.marimo.io/guides/apps.html#grid-layout
from marimo.
@mscolnick , Thanks for your help.
Will it be possible to use CSS to increase/remove some functionalities from an active notebook? We are running some courses using Pluto and Julia. In evaluation moments (tests/exams), we have to introduce some changes to the style of the notebook so that students will not have access to some of the notebooks's functionalities. For example, students will not be able to copy markdown text, or code, nor will they be able to create a new cell, or delete an existing one. Will it be possible to produce these kind of changes in marimo?
Thanks
from marimo.
@VivaldoMendes - you can likely design tests/exams as applications (by running marimo run file.py
). if you need code as input from the user, you can do mo.ui.code_editor
to create these kinds of elements.
from marimo.
@mscolnick, thank you very much.
from marimo.
no problem - @VivaldoMendes, im going to close this but please reach out if you have any more questions
from marimo.
Related Issues (20)
- marimo edit hangs HOT 5
- `mo.ui.table` for Pandas Dataframe do not work in HTML exports HOT 5
- Changing the position of a set of cells HOT 2
- add `packaging` to dependencies? HOT 2
- live documentation changes format while typing argument to function I'm looking at docs of
- Feedback when stale cell is queued (lazy executor) HOT 4
- Request to manually edit dependencies
- Callouts: a bug and a suggestion HOT 2
- Brush Transparency Issue in Chart Rendering HOT 9
- Dict comprehension with form leads to TypeError('cannot pickle '_thread.lock' object') HOT 1
- SyntaxError causes cell to lock up HOT 2
- Support stateless for multi container scaling and deployment
- A small bug and one shortcut gone (or two) HOT 6
- TOC in static export of the notebook HOT 4
- Add option to "copy as pathname" to files/folders on the file browser panel HOT 2
- Stale column previews in ui.table
- Slow tests causing CI failures again
- outputting dataframe with tons of columns crashed all marimo browser tabs HOT 2
- Tracebacks with long error messages are truncated on frontend
- displaying a polars dataframe with an array column spews error output HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marimo.