Title: How to read Gutenberg Block Attributes in ViewScript code
Last modified: September 19, 2022

---

# How to read Gutenberg Block Attributes in ViewScript code

 *  [Matteo Bruni](https://wordpress.org/support/users/ar3shack/)
 * (@ar3shack)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/reading-gutenberg-block-attributes-in-viewscript-code/)
 * Hello,
 * I’m creating a Gutenberg block using JavaScript but I’m struggling with attributes.
 * I don’t understand how to make them editable in the right sidebar and how to 
   retrieve the block values in the ViewScript file.
 * You can see what I’ve done so far here: [https://github.com/matteobruni/tsparticles/tree/dev/components/wordpress/src](https://github.com/matteobruni/tsparticles/tree/dev/components/wordpress/src)
    -  This topic was modified 3 years, 8 months ago by [Matteo Bruni](https://wordpress.org/support/users/ar3shack/).

Viewing 1 replies (of 1 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/reading-gutenberg-block-attributes-in-viewscript-code/#post-16035611)
 * If I’m looking at it correctly, you’ve already found the right element with InspectorControls
   to place new options in the sidebar on the right. The manual for this is here:
   
   [https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar/](https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar/)
 * Your code for this has also changed after your post here. Have you already found
   your solution?

Viewing 1 replies (of 1 total)

The topic ‘How to read Gutenberg Block Attributes in ViewScript code’ is closed 
to new replies.

## Tags

 * [gutenberg](https://wordpress.org/support/topic-tag/gutenberg/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/reading-gutenberg-block-attributes-in-viewscript-code/#post-16035611)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
